diff options
author | Joey Hess <joey@kitenet.net> | 2013-04-06 18:29:52 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-04-06 18:29:52 -0400 |
commit | 096078683033b6c500319d1880879a4b82c6c472 (patch) | |
tree | 9c196e99076444dcf1935228470fb9ad6f5b8456 /Types/StandardGroups.hs | |
parent | dba7d9163a9aad6699fcaf229320f9783b7e8bf3 (diff) |
better archive directory handling
Adjust preferred content expressions so that content in archive directories
is preferred until it has reached an archive or smallarchive repository.
Diffstat (limited to 'Types/StandardGroups.hs')
-rw-r--r-- | Types/StandardGroups.hs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/Types/StandardGroups.hs b/Types/StandardGroups.hs index 434600f3f..417d6bec1 100644 --- a/Types/StandardGroups.hs +++ b/Types/StandardGroups.hs @@ -55,21 +55,22 @@ descStandardGroup UnwantedGroup = "unwanted: remove content from this repository {- See doc/preferred_content.mdwn for explanations of these expressions. -} preferredContent :: StandardGroup -> String -preferredContent ClientGroup = lastResort - "exclude=*/archive/* and exclude=archive/*" -preferredContent TransferGroup = lastResort - "not (inallgroup=client and copies=client:2) and " ++ preferredContent ClientGroup +preferredContent ClientGroup = lastResort $ + "(exclude=*/archive/* and exclude=archive/*) or (" ++ notArchived ++ ")" +preferredContent TransferGroup = lastResort $ + "not (inallgroup=client and copies=client:2) and (" ++ preferredContent ClientGroup ++ ")" preferredContent BackupGroup = "include=*" -preferredContent IncrementalBackupGroup = lastResort +preferredContent IncrementalBackupGroup = lastResort $ "include=* and (not copies=incrementalbackup:1)" preferredContent SmallArchiveGroup = lastResort $ - "(include=*/archive/* or include=archive/*) and " ++ preferredContent FullArchiveGroup -preferredContent FullArchiveGroup = lastResort - "not (copies=archive:1 or copies=smallarchive:1)" + "(include=*/archive/* or include=archive/*) and (" ++ preferredContent FullArchiveGroup ++ ")" +preferredContent FullArchiveGroup = lastResort notArchived preferredContent SourceGroup = "not (copies=1)" -preferredContent ManualGroup = lastResort - "present and exclude=*/archive/* and exclude=archive/*" +preferredContent ManualGroup = "present and (" ++ preferredContent ClientGroup ++ ")" preferredContent UnwantedGroup = "exclude=*" + +notArchived :: String +notArchived = "not (copies=archive:1 or copies=smallarchive:1)" {- Most repositories want any content that is only on untrusted - or dead repositories. -} |