summaryrefslogtreecommitdiff
path: root/Command/Status.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-11-14 16:14:17 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-11-14 16:14:17 -0400
commitaa4fbbdd33c4d584b734476a341a0c38980281a6 (patch)
tree82bd06cee09db8cf4bb112652374e5e2df920ce0 /Command/Status.hs
parent04edae6791b4eddaa77dda2407264dc4434d74b7 (diff)
status: Now displays trusted, untrusted, and semitrusted repositories separately.
Diffstat (limited to 'Command/Status.hs')
-rw-r--r--Command/Status.hs16
1 files changed, 11 insertions, 5 deletions
diff --git a/Command/Status.hs b/Command/Status.hs
index 53d64d042..e66f59858 100644
--- a/Command/Status.hs
+++ b/Command/Status.hs
@@ -24,6 +24,7 @@ import Annex.Content
import Types.Key
import Backend
import Logs.UUID
+import Logs.Trust
import Remote
-- a named computation that produces a statistic
@@ -52,7 +53,9 @@ stats :: [Stat]
stats =
[ supported_backends
, supported_remote_types
- , remote_list
+ , remote_list Trusted "trusted"
+ , remote_list UnTrusted "untrusted"
+ , remote_list SemiTrusted "semitrusted"
, tmp_size
, bad_data_size
, local_annex_keys
@@ -90,10 +93,13 @@ supported_remote_types :: Stat
supported_remote_types = stat "supported remote types" $
return $ unwords $ map R.typename Remote.remoteTypes
-remote_list :: Stat
-remote_list = stat "known repositories" $ lift $ do
- s <- prettyPrintUUIDs "repos" =<< M.keys <$> uuidMap
- return $ '\n':init s
+remote_list :: TrustLevel -> String -> Stat
+remote_list level desc = stat n $ lift $ do
+ us <- M.keys <$> uuidMap
+ s <- prettyPrintUUIDs n =<< fst <$> trustPartition level us
+ return $ if null s then "none" else '\n':init s
+ where
+ n = desc ++ " repositories"
local_annex_size :: Stat
local_annex_size = stat "local annex size" $