summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-01-01 16:13:16 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-01-01 16:13:16 -0400
commit3732d4a2673cbe5e7b4c39b7fa2c211da0689d84 (patch)
tree54fd747ae61cb691fcbf2a5892808df4cb3a4a4c
parent782956d7fbfd420d08c212538df887f5b22eb4a6 (diff)
info: Fix "backend usage" numbers, which were counting present keys twice.
Let's just count the referenced keys for that, and not present keys at all.
-rw-r--r--Command/Info.hs5
-rw-r--r--debian/changelog2
2 files changed, 3 insertions, 4 deletions
diff --git a/Command/Info.hs b/Command/Info.hs
index d22c23c04..763279612 100644
--- a/Command/Info.hs
+++ b/Command/Info.hs
@@ -403,11 +403,8 @@ disk_size = simpleStat "available local disk space" $
backend_usage :: Stat
backend_usage = stat "backend usage" $ json fmt $
- calc
- <$> (backendsKeys <$> cachedReferencedData)
- <*> (backendsKeys <$> cachedPresentData)
+ sort . M.toList . backendsKeys <$> cachedReferencedData
where
- calc x y = sort $ M.toList $ M.unionWith (+) x y
fmt = multiLine . map (\(n, b) -> b ++ ": " ++ show n) . map swap
numcopies_stats :: Stat
diff --git a/debian/changelog b/debian/changelog
index 070c5644f..0563eba43 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -33,6 +33,8 @@ git-annex (6.20151219) UNRELEASED; urgency=medium
* Debian: Adjust build dependencies for webapp, DAV. Now available on
mips, mipsel, but temporarily removed armel since build is failing
there.
+ * info: Fix "backend usage" numbers, which were counting present keys
+ twice.
-- Joey Hess <id@joeyh.name> Sat, 19 Dec 2015 13:31:17 -0400