summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2016-06-18 01:21:01 -0400
committerJoey Hess2016-06-18 01:21:01 -0400
commit308e0447a3cb27f20256ba31c2e1b8f6b52c9e1a (patch)
tree1e6e5c6a958f60a6e6199849cd2857fbaf6c7e32
parente61097439faba55e4647608eecf915bf3290905f (diff)
Really make Apt.install fail when asked to install a package that apt does not know about
-rw-r--r--src/Propellor/Property/Apt.hs5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/Propellor/Property/Apt.hs b/src/Propellor/Property/Apt.hs
index 279a5da8..196fb345 100644
--- a/src/Propellor/Property/Apt.hs
+++ b/src/Propellor/Property/Apt.hs
@@ -154,7 +154,7 @@ installed :: [Package] -> Property DebianLike
installed = installed' ["-y"]
installed' :: [String] -> [Package] -> Property DebianLike
-installed' params ps = robustly $ check (isInstallable ps) go
+installed' params ps = robustly $ check (not <$> isInstalled' ps) go
`describe` unwords ("apt installed":ps)
where
go = runApt (params ++ ["install"] ++ ps)
@@ -201,9 +201,6 @@ buildDepIn dir = cmdPropertyEnv "sh" ["-c", cmd] noninteractiveEnv
robustly :: Property DebianLike -> Property DebianLike
robustly p = p `fallback` (update `before` p)
-isInstallable :: [Package] -> IO Bool
-isInstallable ps = any (== NotInstalled) <$> getInstallStatus ps
-
isInstalled :: Package -> IO Bool
isInstalled p = isInstalled' [p]