summaryrefslogtreecommitdiff
path: root/Command/Fsck.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-01-21 17:08:49 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-01-21 17:25:39 -0400
commitd44bd607d4fd18eadabe3c7693ebcf1c74aae63e (patch)
tree83e8867f45199ece960fc67e4d31f1d9b4a5d56a /Command/Fsck.hs
parentd5f7fb27aad3e2e9c4bebb9ccd5577af8deb25c7 (diff)
numcopies cleanup, part 2
This includes several bug fixes.
Diffstat (limited to 'Command/Fsck.hs')
-rw-r--r--Command/Fsck.hs11
1 files changed, 5 insertions, 6 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index 839ab1d71..598025189 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -119,7 +119,7 @@ start from inc file (key, backend) = do
where
go = runFsck inc file key
-perform :: Key -> FilePath -> Backend -> Maybe NumCopies -> Annex Bool
+perform :: Key -> FilePath -> Backend -> NumCopies -> Annex Bool
perform key file backend numcopies = check
-- order matters
[ fixLink key file
@@ -133,7 +133,7 @@ perform key file backend numcopies = check
{- To fsck a remote, the content is retrieved to a tmp file,
- and checked locally. -}
-performRemote :: Key -> FilePath -> Backend -> Maybe NumCopies -> Remote -> Annex Bool
+performRemote :: Key -> FilePath -> Backend -> NumCopies -> Remote -> Annex Bool
performRemote key file backend numcopies remote =
dispatch =<< Remote.hasKey remote key
where
@@ -369,15 +369,14 @@ checkBackendOr' bad backend key file postcheck =
, return True
)
-checkKeyNumCopies :: Key -> FilePath -> Maybe NumCopies -> Annex Bool
+checkKeyNumCopies :: Key -> FilePath -> NumCopies -> Annex Bool
checkKeyNumCopies key file numcopies = do
- needed <- getNumCopies numcopies
(untrustedlocations, safelocations) <- trustPartition UnTrusted =<< Remote.keyLocations key
let present = NumCopies (length safelocations)
- if present < needed
+ if present < numcopies
then do
ppuuids <- Remote.prettyPrintUUIDs "untrusted" untrustedlocations
- warning $ missingNote file present needed ppuuids
+ warning $ missingNote file present numcopies ppuuids
return False
else return True