limitCopies :: MkLimit
limitCopies want = case split ":" want of
- [v, n] -> case readTrustLevel v of
- Just trust -> go n $ checktrust trust
+ [v, n] -> case parsetrustspec v of
+ Just pred -> go n $ checktrust pred
Nothing -> go n $ checkgroup v
[n] -> go n $ const $ return True
_ -> Left "bad value for copies"
us <- filter (`S.notMember` notpresent)
<$> (filterM good =<< Remote.keyLocations key)
return $ length us >= n
- checktrust t u = (== t) <$> lookupTrust u
+ checktrust pred u = pred <$> lookupTrust u
checkgroup g u = S.member g <$> lookupGroups u
+ parsetrustspec s
+ | "+" `isSuffixOf` s = (>=) <$> readTrustLevel (beginning s)
+ | otherwise = (==) <$> readTrustLevel s
{- Adds a limit to skip files not believed to be present in all
- repositories in the specified group. -}
copies, on remotes with the specified trust level. For example,
"--copies=trusted:2"
+ To match any trust level at or higher than a given level, use
+ 'trustlevel+'. For example, "--copies=semitrusted+:2"
+
* --copies=groupname:number
Matches only files that git-annex believes have the specified number of
All content is preferred, unless it's in a "archive" directory.
-`(exclude=*/archive/* and exclude=archive/*) or (not copies=semitrusted:1)`
+`(exclude=*/archive/* and exclude=archive/*) or (not copies=semitrusted+:1)`
### transfer
The preferred content expression for these causes them to get and retain
data until all clients have a copy.
-`(not (inallgroup=client and copies=client:2) and exclude=*/archive/* and exclude=archive/*) or (not copies=semitrusted:1)`
+`(not (inallgroup=client and copies=client:2) and exclude=*/archive/* and exclude=archive/*) or (not copies=semitrusted+:1)`
The "copies=client:2" part of the above handles the case where
there is only one client repository. It makes a transfer repository
Only prefers content that's not already backed up to another backup
or incremental backup repository.
-`(include=* and (not copies=backup:1) and (not copies=incrementalbackup:1)) or (not copies=semitrusted:1)`
+`(include=* and (not copies=backup:1) and (not copies=incrementalbackup:1)) or (not copies=semitrusted+:1)`
### small archive
Only prefers content that's located in an "archive" directory, and
only if it's not already been archived somewhere else.
-`((include=*/archive/* or include=archive/*) and not (copies=archive:1 or copies=smallarchive:1)) or (not copies=semitrusted:1)`
+`((include=*/archive/* or include=archive/*) and not (copies=archive:1 or copies=smallarchive:1)) or (not copies=semitrusted+:1)`
### full archive
All content is preferred, unless it's already been archived somewhere else.
-`(not (copies=archive:1 or copies=smallarchive:1)) or (not copies=semitrusted:1)`
+`(not (copies=archive:1 or copies=smallarchive:1)) or (not copies=semitrusted+:1)`
Note that if you want to archive multiple copies (not a bad idea!),
you should instead configure all your archive repositories with a
Only content that is present is preferred. Content in "archive"
directories is never preferred.
-`(present and exclude=*/archive/* and exclude=archive/*) or (not copies=semitrusted:1)`
+`(present and exclude=*/archive/* and exclude=archive/*) or (not copies=semitrusted+:1)`
### unwanted