move nubbing into function whose algo needs a nubbed list
This commit is contained in:
parent
607eed0de2
commit
9f3e51dd51
2 changed files with 4 additions and 3 deletions
|
@ -99,7 +99,8 @@ verifyEnoughCopies
|
||||||
-> [UUID] -- repos that are trusted or already verified to have it
|
-> [UUID] -- repos that are trusted or already verified to have it
|
||||||
-> [Remote] -- remotes to check to see if they have it
|
-> [Remote] -- remotes to check to see if they have it
|
||||||
-> Annex Bool
|
-> Annex Bool
|
||||||
verifyEnoughCopies nolocmsg key need skip = helper [] []
|
verifyEnoughCopies nolocmsg key need skip trusted tocheck =
|
||||||
|
helper [] [] (nub trusted) (nub tocheck)
|
||||||
where
|
where
|
||||||
helper bad missing have []
|
helper bad missing have []
|
||||||
| NumCopies (length have) >= need = return True
|
| NumCopies (length have) >= need = return True
|
||||||
|
@ -140,7 +141,7 @@ knownCopies key = do
|
||||||
(remotes, trusteduuids) <- Remote.keyPossibilitiesTrusted key
|
(remotes, trusteduuids) <- Remote.keyPossibilitiesTrusted key
|
||||||
u <- getUUID
|
u <- getUUID
|
||||||
trusteduuids' <- ifM (inAnnex key <&&> (<= SemiTrusted) <$> lookupTrust u)
|
trusteduuids' <- ifM (inAnnex key <&&> (<= SemiTrusted) <$> lookupTrust u)
|
||||||
( pure (nub (u:trusteduuids))
|
( pure (u:trusteduuids)
|
||||||
, pure trusteduuids
|
, pure trusteduuids
|
||||||
)
|
)
|
||||||
return (remotes, trusteduuids')
|
return (remotes, trusteduuids')
|
||||||
|
|
|
@ -72,7 +72,7 @@ performLocal key afile numcopies knownpresentremote = lockContent key $ \content
|
||||||
(remotes, trusteduuids) <- Remote.keyPossibilitiesTrusted key
|
(remotes, trusteduuids) <- Remote.keyPossibilitiesTrusted key
|
||||||
let trusteduuids' = case knownpresentremote of
|
let trusteduuids' = case knownpresentremote of
|
||||||
Nothing -> trusteduuids
|
Nothing -> trusteduuids
|
||||||
Just r -> nub (Remote.uuid r:trusteduuids)
|
Just r -> Remote.uuid r:trusteduuids
|
||||||
untrusteduuids <- trustGet UnTrusted
|
untrusteduuids <- trustGet UnTrusted
|
||||||
let tocheck = Remote.remotesWithoutUUID remotes (trusteduuids'++untrusteduuids)
|
let tocheck = Remote.remotesWithoutUUID remotes (trusteduuids'++untrusteduuids)
|
||||||
u <- getUUID
|
u <- getUUID
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue