From 388257ea3e738e2236f3560b960ac061993cca14 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 25 Sep 2017 12:02:12 -0400 Subject: Apt.isInstalled: Fix handling of packages that are not known at all to apt. getInstallStatus returns [] when passed only such packages, and all of that list == IsInstalled. So also check that the list contains every package queried. --- src/Propellor/Property/Apt.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Propellor/Property/Apt.hs') diff --git a/src/Propellor/Property/Apt.hs b/src/Propellor/Property/Apt.hs index 5630d83a..68ebe89e 100644 --- a/src/Propellor/Property/Apt.hs +++ b/src/Propellor/Property/Apt.hs @@ -331,7 +331,9 @@ isInstalled :: Package -> IO Bool isInstalled p = isInstalled' [p] isInstalled' :: [Package] -> IO Bool -isInstalled' ps = all (== IsInstalled) <$> getInstallStatus ps +isInstalled' ps = do + is <- getInstallStatus ps + return $ all (== IsInstalled) is && length is == length ps data InstallStatus = IsInstalled | NotInstalled deriving (Show, Eq) -- cgit v1.2.3