diff options
author | Joey Hess <joey@kitenet.net> | 2011-01-26 19:35:35 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-01-26 19:35:35 -0400 |
commit | 1a11085a50e79fbcce829d4ea89539107f5b306c (patch) | |
tree | 0952db105a80cd9bdd60f6e9032e1b6aeff4fdda | |
parent | ff3c12725502451c8ab7da72797b2d69c4a66900 (diff) |
drop: suppprt untrusted repos
-rw-r--r-- | Backend/File.hs | 22 | ||||
-rw-r--r-- | debian/changelog | 2 |
2 files changed, 16 insertions, 8 deletions
diff --git a/Backend/File.hs b/Backend/File.hs index 8c39c3f80..ab14b8233 100644 --- a/Backend/File.hs +++ b/Backend/File.hs @@ -96,9 +96,10 @@ checkRemoveKey key numcopiesM = do then return True else do (remotes, trusteduuids) <- Remotes.keyPossibilities key - untrusted <- reposWithoutUUID remotes trusteduuids + untrusteduuids <- trustGet UnTrusted + tocheck <- reposWithoutUUID remotes (trusteduuids++untrusteduuids) numcopies <- getNumCopies numcopiesM - findcopies numcopies trusteduuids untrusted [] + findcopies numcopies trusteduuids tocheck [] where findcopies need have [] bad | length have >= need = return True @@ -131,11 +132,18 @@ showLocations key exclude = do g <- Annex.gitRepo u <- getUUID g uuids <- liftIO $ keyLocations g key - let uuidsf = filter (\l -> l /= u && (not $ elem l exclude)) uuids - ppuuids <- prettyPrintUUIDs uuidsf - if null uuidsf - then showLongNote $ "No other repository is known to contain the file." - else showLongNote $ "Try making some of these repositories available:\n" ++ ppuuids + untrusteduuids <- trustGet UnTrusted + let uuidswanted = filteruuids uuids (u:exclude++untrusteduuids) + let uuidsskipped = filteruuids uuids (u:exclude++uuidswanted) + ppuuidswanted <- prettyPrintUUIDs uuidswanted + ppuuidsskipped <- prettyPrintUUIDs uuidsskipped + showLongNote $ message ppuuidswanted ppuuidsskipped + where + filteruuids list x = filter (\l -> not $ elem l x) list + message [] [] = "No other repository is known to contain the file." + message rs [] = "Try making some of these repositories available:\n" ++ rs + message [] us = "Also these untrusted repositories may contain the file:\n" ++ us + message rs us = message rs [] ++ message [] us showTriedRemotes :: [Git.Repo] -> Annex () showTriedRemotes [] = return () diff --git a/debian/changelog b/debian/changelog index fcd986e1b..c675d1456 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,7 +5,7 @@ git-annex (0.19) UNRELEASED; urgency=low * There are now three levels of repository trust. * untrust: Now marks the current repository as untrusted. * semitrust: Now restores the default trust level. (What untrust used to do.) - * fsck: Take untrusted repositories into account. + * fsck, drop: Take untrusted repositories into account. * bugfix: Files were copied from trusted remotes first even if their annex.cost was higher than other remotes. |