summaryrefslogtreecommitdiff
path: root/Types/StandardGroups.hs
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2013-04-06 18:29:52 -0400
committerJoey Hess <joey@kitenet.net>2013-04-06 18:29:52 -0400
commit84de4a14addd2e413a9e088ba665c9d34dfcb919 (patch)
treef2c650dff940cc7ec7cbf961990e03ceab6c273b /Types/StandardGroups.hs
parent0a77d4b7162cf6e860beb7e5ecab89e44207ab7d (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.hs21
1 files changed, 11 insertions, 10 deletions
diff --git a/Types/StandardGroups.hs b/Types/StandardGroups.hs
index 434600f3f7..417d6bec15 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. -}