summaryrefslogtreecommitdiff
path: root/Types/StandardGroups.hs
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2013-01-21 04:18:05 -0400
committerJoey Hess <joey@kitenet.net>2013-01-21 04:18:46 -0400
commit6a067e5c288a2cde8c6dc635914d34af498499f1 (patch)
tree01043f511acc029f952e09ac925b51eea9ec9478 /Types/StandardGroups.hs
parent8a906b70567fa8d64d5dd9ba45bb8e69f6b16c58 (diff)
manual and source repository groups
Diffstat (limited to 'Types/StandardGroups.hs')
-rw-r--r--Types/StandardGroups.hs17
1 files changed, 16 insertions, 1 deletions
diff --git a/Types/StandardGroups.hs b/Types/StandardGroups.hs
index bdc8c4b66b..5be5fa8b77 100644
--- a/Types/StandardGroups.hs
+++ b/Types/StandardGroups.hs
@@ -7,7 +7,14 @@
module Types.StandardGroups where
-data StandardGroup = ClientGroup | TransferGroup | BackupGroup | SmallArchiveGroup | FullArchiveGroup
+data StandardGroup
+ = ClientGroup
+ | TransferGroup
+ | BackupGroup
+ | SmallArchiveGroup
+ | FullArchiveGroup
+ | SourceGroup
+ | ManualGroup
deriving (Eq, Ord, Enum, Bounded, Show)
fromStandardGroup :: StandardGroup -> String
@@ -16,6 +23,8 @@ fromStandardGroup TransferGroup = "transfer"
fromStandardGroup BackupGroup = "backup"
fromStandardGroup SmallArchiveGroup = "smallarchive"
fromStandardGroup FullArchiveGroup = "archive"
+fromStandardGroup SourceGroup = "source"
+fromStandardGroup ManualGroup = "manual"
toStandardGroup :: String -> Maybe StandardGroup
toStandardGroup "client" = Just ClientGroup
@@ -23,6 +32,8 @@ toStandardGroup "transfer" = Just TransferGroup
toStandardGroup "backup" = Just BackupGroup
toStandardGroup "smallarchive" = Just SmallArchiveGroup
toStandardGroup "archive" = Just FullArchiveGroup
+toStandardGroup "source" = Just SourceGroup
+toStandardGroup "manual" = Just ManualGroup
toStandardGroup _ = Nothing
descStandardGroup :: StandardGroup -> String
@@ -31,6 +42,8 @@ descStandardGroup TransferGroup = "transfer: distributes files to clients"
descStandardGroup BackupGroup = "backup: backs up all files"
descStandardGroup SmallArchiveGroup = "small archive: archives files located in \"archive\" directories"
descStandardGroup FullArchiveGroup = "full archive: archives all files not archived elsewhere"
+descStandardGroup SourceGroup = "file source: moves files on to other repositories"
+descStandardGroup ManualGroup = "manual mode: only stores files you manually choose"
{- See doc/preferred_content.mdwn for explanations of these expressions. -}
preferredContent :: StandardGroup -> String
@@ -39,3 +52,5 @@ preferredContent TransferGroup = "not (inallgroup=client and copies=client:2) an
preferredContent BackupGroup = "include=*"
preferredContent SmallArchiveGroup = "(include=*/archive/* or include=archive/*) and " ++ preferredContent FullArchiveGroup
preferredContent FullArchiveGroup = "not (copies=archive:1 or copies=smallarchive:1)"
+preferredContent SourceGroup = "not (copies=1)"
+preferredContent ManualGroup = "present and exclude=archive/*"