diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-12-05 19:29:15 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-12-05 19:29:15 -0400 |
| commit | d2406996c7d71f310be3d390d531812e3d0d4521 (patch) | |
| tree | 3181ba45b78b1a76f23bc281de4c9c4ca4ce50a2 /src | |
| parent | 277adba731d66e642bc8f5bdfd37c3590ec40ec4 (diff) | |
refactor
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Property/Locale.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Propellor/Property/Locale.hs b/src/Propellor/Property/Locale.hs index 15babf20..29de8df2 100644 --- a/src/Propellor/Property/Locale.hs +++ b/src/Propellor/Property/Locale.hs @@ -34,9 +34,13 @@ locale `selectedFor` vars = select <!> deselect deselect' = cmdProperty "update-locale" vars `assume` MadeChange selectArgs = zipWith (++) vars (repeat ('=':locale)) - isselected = do - ls <- catchDefaultIO [] $ lines <$> readFile "/etc/default/locale" - return $ and $ map (\v -> v ++ "=" ++ locale `elem` ls) vars + isselected = locale `isSelectedFor` vars + +isSelectedFor :: Locale -> [LocaleVariable] -> IO Bool +locale `isSelectedFor` vars = do + ls <- catchDefaultIO [] $ lines <$> readFile "/etc/default/locale" + return $ and $ map (\v -> v ++ "=" ++ locale `elem` ls) vars + -- | Ensures a locale is generated (or, if reverted, ensure it's not). -- |
