diff options
author | 2015-10-08 17:58:32 -0400 | |
---|---|---|
committer | 2015-10-08 17:58:32 -0400 | |
commit | a56d3c92b9672c6d84ac007a404b07d3eeb51025 (patch) | |
tree | 2264ea086ca39f7243deb1adfcb085551006b07d /Command | |
parent | d5494842274030d21356c7492e6de5969173c34d (diff) |
support invalidating existing VerifiedCopys
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Drop.hs | 5 | ||||
-rw-r--r-- | Command/Import.hs | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/Command/Drop.hs b/Command/Drop.hs index 49e4bea85..26872c6c0 100644 --- a/Command/Drop.hs +++ b/Command/Drop.hs @@ -95,7 +95,7 @@ startRemote afile numcopies key remote = do performLocal :: Key -> AssociatedFile -> NumCopies -> [VerifiedCopy] -> CommandPerform performLocal key afile numcopies preverified = lockContentExclusive key $ \contentlock -> do (remotes, trusteduuids) <- Remote.keyPossibilitiesTrusted key - let preverified' = preverified ++ map TrustedCopy trusteduuids + let preverified' = preverified ++ map (mkVerifiedCopy TrustedCopy) trusteduuids untrusteduuids <- trustGet UnTrusted let tocheck = Remote.remotesWithoutUUID remotes (map toUUID preverified'++untrusteduuids) u <- getUUID @@ -117,10 +117,11 @@ performRemote key afile numcopies remote = do -- as long as the local repo is not untrusted. (remotes, trusteduuids) <- knownCopies key let trusted = filter (/= uuid) trusteduuids + let preverified = map (mkVerifiedCopy TrustedCopy) trusted untrusteduuids <- trustGet UnTrusted let tocheck = filter (/= remote) $ Remote.remotesWithoutUUID remotes (trusted++untrusteduuids) - stopUnless (canDrop uuid key afile numcopies [uuid] (map TrustedCopy trusted) tocheck) $ do + stopUnless (canDrop uuid key afile numcopies [uuid] preverified tocheck) $ do ok <- Remote.removeKey remote key next $ cleanupRemote key remote ok where diff --git a/Command/Import.hs b/Command/Import.hs index fbce4c55a..3206ad48b 100644 --- a/Command/Import.hs +++ b/Command/Import.hs @@ -143,4 +143,4 @@ verifiedExisting key destfile = do (remotes, trusteduuids) <- knownCopies key untrusteduuids <- trustGet UnTrusted let tocheck = Remote.remotesWithoutUUID remotes (trusteduuids++untrusteduuids) - verifyEnoughCopies [] key need [] (map TrustedCopy trusteduuids) tocheck + verifyEnoughCopies [] key need [] (map (mkVerifiedCopy TrustedCopy) trusteduuids) tocheck |