diff options
| author | Joey Hess <joeyh@joeyh.name> | 2017-02-26 16:11:38 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2017-02-26 16:17:19 -0400 |
| commit | 55ed8e8743e861e2230e40670a56034353cf4e32 (patch) | |
| tree | 3e5f8a965569f1dcf8a7c3cabd10e663924208dd /src/Propellor/Property/FreeBSD | |
| parent | 2ba4b6fb3d29b2b65aa60f4bd591ed8cf6a63e27 (diff) | |
use ConfigurableValue where applicable
* Removed fromPort (use val instead). (API change)
* Removed several Show instances that were only used for generating
configuration, replacing with ConfigurableValue instances. (API change)
It's somewhat annoying that IsInfo requires a Show instance.
That's needed to be able to display Info in ghci, but some non-derived Show
instances had to be kept to support that.
Diffstat (limited to 'src/Propellor/Property/FreeBSD')
| -rw-r--r-- | src/Propellor/Property/FreeBSD/Poudriere.hs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Propellor/Property/FreeBSD/Poudriere.hs b/src/Propellor/Property/FreeBSD/Poudriere.hs index 58477468..e6ddea16 100644 --- a/src/Propellor/Property/FreeBSD/Poudriere.hs +++ b/src/Propellor/Property/FreeBSD/Poudriere.hs @@ -19,6 +19,7 @@ poudriereConfigPath = "/usr/local/etc/poudriere.conf" newtype PoudriereConfigured = PoudriereConfigured String deriving (Typeable, Monoid, Show) + instance IsInfo PoudriereConfigured where propagateInfo _ = False @@ -68,7 +69,7 @@ jail j@(Jail name version arch) = tightenTargets $ nx <- liftIO $ not <$> jailExists j return $ c && nx - (cmd, args) = poudriereCommand "jail" ["-c", "-j", name, "-a", show arch, "-v", show version] + (cmd, args) = poudriereCommand "jail" ["-c", "-j", name, "-a", val arch, "-v", val version] createJail = cmdProperty cmd args in check chk createJail @@ -101,9 +102,10 @@ data PoudriereZFS = PoudriereZFS ZFS.ZFS ZFS.ZFSProperties data Jail = Jail String FBSDVersion PoudriereArch data PoudriereArch = I386 | AMD64 deriving (Eq) -instance Show PoudriereArch where - show I386 = "i386" - show AMD64 = "amd64" + +instance ConfigurableValue PoudriereArch where + val I386 = "i386" + val AMD64 = "amd64" fromArchitecture :: Architecture -> PoudriereArch fromArchitecture X86_64 = AMD64 @@ -127,7 +129,7 @@ instance ToShellConfigLines PoudriereZFS where toAssoc (PoudriereZFS (ZFS.ZFS (ZFS.ZPool pool) dataset) _) = [ ("NO_ZFS", "no") , ("ZPOOL", pool) - , ("ZROOTFS", show dataset) + , ("ZROOTFS", val dataset) ] type ConfigLine = String |
