From b9d9333e030ac59ea11d435b7e2e4758daff4b4a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 18 Jan 2019 02:19:06 -0400 Subject: fix withOS type level bug withOS had a type level bug that allowed ensureProperty to be used inside it with a Property that does not match the type of the withOS itself. Propellor.Property.Cron.runPropellor is a Property DebianLike; it was incorrectly a Property UnixLike before and that wrong type was hidden by the withOS bug. This commit was sponsored by Jack Hill on Patreon. --- src/Propellor/Property/Systemd.hs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src/Propellor/Property/Systemd.hs') diff --git a/src/Propellor/Property/Systemd.hs b/src/Propellor/Property/Systemd.hs index cb63ff5a..9c9f5914 100644 --- a/src/Propellor/Property/Systemd.hs +++ b/src/Propellor/Property/Systemd.hs @@ -204,13 +204,18 @@ killUserProcesses = set "yes" set "no" -- | Ensures machined and machinectl are installed machined :: Property Linux -machined = withOS "machined installed" $ \w o -> - case o of - -- Split into separate debian package since systemd 225. - (Just (System (Debian _ suite) _)) - | not (isStable suite) || suite == (Stable "stretch") -> - ensureProperty w $ Apt.installed ["systemd-container"] - _ -> noChange +machined = installeddebian `pickOS` assumeinstalled + where + installeddebian :: Property DebianLike + installeddebian = withOS "machined installed" $ \w o -> + case o of + -- Split into separate debian package since systemd 225. + (Just (System (Debian _ suite) _)) + | not (isStable suite) || suite == (Stable "stretch") -> + ensureProperty w $ Apt.installed ["systemd-container"] + _ -> noChange + assumeinstalled :: Property Linux + assumeinstalled = doNothing -- | Defines a container with a given machine name, -- and how to create its chroot if not already present. -- cgit v1.2.3