From 308e0447a3cb27f20256ba31c2e1b8f6b52c9e1a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 18 Jun 2016 01:21:01 -0400 Subject: Really make Apt.install fail when asked to install a package that apt does not know about --- src/Propellor/Property/Apt.hs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/Propellor/Property/Apt.hs') 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] -- cgit v1.2.3