From 93a2b92f6215eb4b3b5bd81a2417f0edddea598c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 17 Jul 2014 23:41:17 -0400 Subject: propellor spin --- src/Propellor/Property/Postfix.hs | 13 +++++++------ 1 file 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 = -- cgit v1.2.3