aboutsummaryrefslogtreecommitdiff
path: root/Types/StandardGroups.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-01-01 19:58:02 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-01-01 19:58:02 -0400
commita62d941be1e90d13d4dddbe86d75c050f22cd61d (patch)
treea77dfd1e1241f49de288dc77c1a0440d156efa61 /Types/StandardGroups.hs
parent57a9ed50e6cb090fcd1aba7d7b48a19cbe50bc56 (diff)
add PreferredContentExpression type
Diffstat (limited to 'Types/StandardGroups.hs')
-rw-r--r--Types/StandardGroups.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Types/StandardGroups.hs b/Types/StandardGroups.hs
index 2d977a357..51788ec4e 100644
--- a/Types/StandardGroups.hs
+++ b/Types/StandardGroups.hs
@@ -12,6 +12,8 @@ import Types.Remote (RemoteConfig)
import qualified Data.Map as M
import Data.Maybe
+type PreferredContentExpression = String
+
data StandardGroup
= ClientGroup
| TransferGroup
@@ -71,7 +73,7 @@ associatedDirectory Nothing PublicGroup = Just "public"
associatedDirectory _ _ = Nothing
{- See doc/preferred_content.mdwn for explanations of these expressions. -}
-preferredContent :: StandardGroup -> String
+preferredContent :: StandardGroup -> PreferredContentExpression
preferredContent ClientGroup = lastResort $
"(exclude=*/archive/* and exclude=archive/*) or (" ++ notArchived ++ ")"
preferredContent TransferGroup = lastResort $
@@ -92,5 +94,5 @@ notArchived = "not (copies=archive:1 or copies=smallarchive:1)"
{- Most repositories want any content that is only on untrusted
- or dead repositories. -}
-lastResort :: String -> String
+lastResort :: String -> PreferredContentExpression
lastResort s = "(" ++ s ++ ") or (not copies=semitrusted+:1)"