webapp and assistant glacier support
This commit is contained in:
parent
c282c8b492
commit
463cf58140
23 changed files with 321 additions and 185 deletions
|
@ -7,31 +7,35 @@
|
|||
|
||||
module Types.StandardGroups where
|
||||
|
||||
data StandardGroup = ClientGroup | TransferGroup | ArchiveGroup | BackupGroup
|
||||
data StandardGroup = ClientGroup | TransferGroup | BackupGroup | SmallArchiveGroup | FullArchiveGroup
|
||||
deriving (Eq, Ord, Enum, Bounded, Show)
|
||||
|
||||
fromStandardGroup :: StandardGroup -> String
|
||||
fromStandardGroup ClientGroup = "client"
|
||||
fromStandardGroup TransferGroup = "transfer"
|
||||
fromStandardGroup ArchiveGroup = "archive"
|
||||
fromStandardGroup BackupGroup = "backup"
|
||||
fromStandardGroup SmallArchiveGroup = "smallarchive"
|
||||
fromStandardGroup FullArchiveGroup = "archive"
|
||||
|
||||
toStandardGroup :: String -> Maybe StandardGroup
|
||||
toStandardGroup "client" = Just ClientGroup
|
||||
toStandardGroup "transfer" = Just TransferGroup
|
||||
toStandardGroup "archive" = Just ArchiveGroup
|
||||
toStandardGroup "backup" = Just BackupGroup
|
||||
toStandardGroup "smallarchive" = Just SmallArchiveGroup
|
||||
toStandardGroup "archive" = Just FullArchiveGroup
|
||||
toStandardGroup _ = Nothing
|
||||
|
||||
descStandardGroup :: StandardGroup -> String
|
||||
descStandardGroup ClientGroup = "client: a repository on your computer"
|
||||
descStandardGroup TransferGroup = "transfer: distributes files to clients"
|
||||
descStandardGroup ArchiveGroup = "archive: collects files that are not archived elsewhere"
|
||||
descStandardGroup BackupGroup = "backup: collects all files"
|
||||
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"
|
||||
|
||||
{- See doc/preferred_content.mdwn for explanations of these expressions. -}
|
||||
preferredContent :: StandardGroup -> String
|
||||
preferredContent ClientGroup = "exclude=*/archive/*"
|
||||
preferredContent ClientGroup = "exclude=*/archive/* and exclude=archive/*"
|
||||
preferredContent TransferGroup = "not (inallgroup=client and copies=client:2) and " ++ preferredContent ClientGroup
|
||||
preferredContent ArchiveGroup = "not copies=archive:1"
|
||||
preferredContent BackupGroup = "" -- all content is preferred
|
||||
preferredContent SmallArchiveGroup = "(include=*/archive/* or include=archive/*) and " ++ preferredContent FullArchiveGroup
|
||||
preferredContent FullArchiveGroup = "not (copies=archive:1 or copies=smallarchive:1)"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue