summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Postfix.hs
diff options
context:
space:
mode:
authorJoey Hess2014-07-17 23:41:17 -0400
committerJoey Hess2014-07-17 23:41:17 -0400
commit93a2b92f6215eb4b3b5bd81a2417f0edddea598c (patch)
treebc6b87798f0c26360050fb212f574d5adad3e8e1 /src/Propellor/Property/Postfix.hs
parent62f4e589852dd967495638be9aaa38c18a4c622c (diff)
propellor spin
Diffstat (limited to 'src/Propellor/Property/Postfix.hs')
-rw-r--r--src/Propellor/Property/Postfix.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Propellor/Property/Postfix.hs b/src/Propellor/Property/Postfix.hs
index 027ea4cf..1cfc64d3 100644
--- a/src/Propellor/Property/Postfix.hs
+++ b/src/Propellor/Property/Postfix.hs
@@ -49,12 +49,13 @@ mappedFile f setup = setup f
-- Note that multiline configurations that continue onto the next line
-- are not currently supported.
dedupMainCf :: Property
-dedupMainCf = fileProperty "postfix main.cf dedupped" go mainCf
- where
- go ls =
- let parsed = map parse ls
- in dedup [] (keycounts $ rights parsed) parsed
-
+dedupMainCf = fileProperty "postfix main.cf dedupped" dedupCf mainCf
+
+dedupCf :: [String] -> [String]
+dedupCf ls =
+ let parsed = map parse ls
+ in dedup [] (keycounts $ rights parsed) parsed
+ where
parse l
| "#" `isPrefixOf` l = Left l
| "=" `isInfixOf` l =