don't count clusters as copies, continued

Handled limitCopies, as well as everything using fromNumCopies and
fromMinCopies.

This should be everything, probably.

Note that, git-annex info displays a count of repositories, which still
includes cluster. I think that's ok. It would be possible to filter out
clusters there, but to the user they're pretty much just another
repository. The numcopies displayed by eg `git-annex info .` does not
include clusters.
This commit is contained in:
Joey Hess 2024-06-16 15:07:48 -04:00
parent 780367200b
commit 64afbb0b93
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 15 additions and 12 deletions

View file

@ -253,7 +253,7 @@ checkDropAuto automode mremote afile key a =
uuid <- getUUID
let remoteuuid = fromMaybe uuid $ Remote.uuid <$> mremote
locs' <- trustExclude UnTrusted $ filter (/= remoteuuid) locs
if length locs' >= fromNumCopies numcopies
if numCopiesCheck'' locs' (>=) numcopies
then a numcopies mincopies
else stop
| otherwise = a numcopies mincopies

View file

@ -573,7 +573,7 @@ checkKeyNumCopies key afile numcopies = do
locs <- loggedLocations key
(untrustedlocations, otherlocations) <- trustPartition UnTrusted locs
(deadlocations, safelocations) <- trustPartition DeadTrusted otherlocations
let present = length safelocations
let present = numCopiesCount safelocations
if present < fromNumCopies numcopies
then ifM (checkDead key)
( do