summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoey Hess2014-12-01 11:59:38 -0400
committerJoey Hess2014-12-01 11:59:38 -0400
commit8b70031a78969fae8418d647d64fc7a90485b916 (patch)
tree967a7ad6efc28be2b11d6005aa8cdcd0152ade0e /src
parentd84e7a2848be31a08570e683eb20ac2451d14a78 (diff)
parentc9d09afafac30ab40f16faf45a216782fb02c39b (diff)
Merge branch 'joeyconfig'
Diffstat (limited to 'src')
-rw-r--r--src/Propellor/Property/Apt.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Propellor/Property/Apt.hs b/src/Propellor/Property/Apt.hs
index 471d6195..68e877ed 100644
--- a/src/Propellor/Property/Apt.hs
+++ b/src/Propellor/Property/Apt.hs
@@ -193,13 +193,15 @@ isInstalled p = (== [True]) <$> isInstalled' [p]
-- even vary. If apt does not know about a package at all, it will not
-- be included in the result list.
isInstalled' :: [Package] -> IO [Bool]
-isInstalled' ps = catMaybes . map parse . lines
- <$> readProcess "apt-cache" ("policy":ps)
+isInstalled' ps = catMaybes . map parse . lines <$> policy
where
parse l
| "Installed: (none)" `isInfixOf` l = Just False
| "Installed: " `isInfixOf` l = Just True
| otherwise = Nothing
+ policy = do
+ environ <- addEntry "LANG" "C" <$> getEnvironment
+ readProcessEnv "apt-cache" ("policy":ps) (Just environ)
autoRemove :: Property
autoRemove = runApt ["-y", "autoremove"]