From 12548bae3d8feecce6a322162d91b827289ae824 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 5 Dec 2015 17:52:43 -0400 Subject: UncheckedProperty for cmdProperty et al * Properties that run an arbitrary command, such as cmdProperty and scriptProperty are converted to use UncheckedProperty, since they cannot tell on their own if the command truely made a change or not. (API Change) Transition guide: - When GHC complains about an UncheckedProperty, add: `assume` MadeChange - Since these properties used to always return MadeChange, that change is always safe to make. - Or, if you know that the command should modifiy a file, use: `changesFile` filename * A few properties have had their Result improved, for example Apt.buldDep and Apt.autoRemove now check if a change was made or not. --- src/Propellor/Property/Hostname.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/Propellor/Property/Hostname.hs') diff --git a/src/Propellor/Property/Hostname.hs b/src/Propellor/Property/Hostname.hs index 4597b178..fcb88f59 100644 --- a/src/Propellor/Property/Hostname.hs +++ b/src/Propellor/Property/Hostname.hs @@ -45,10 +45,11 @@ setTo' extractdomain hn = combineProperties desc go [ Just $ "/etc/hostname" `File.hasContent` [basehost] , if null domain then Nothing - else Just $ trivial $ hostsline "127.0.1.1" [hn, basehost] - , Just $ trivial $ hostsline "127.0.0.1" ["localhost"] - , Just $ trivial $ check (not <$> inChroot) $ + else Just $ hostsline "127.0.1.1" [hn, basehost] + , Just $ hostsline "127.0.0.1" ["localhost"] + , Just $ check (not <$> inChroot) $ cmdProperty "hostname" [basehost] + `assume` NoChange , Just $ "/etc/mailname" `File.hasContent` [if null domain then hn else domain] ] -- cgit v1.2.3