summaryrefslogtreecommitdiff
path: root/src/Propellor/Types/OS.hs
diff options
context:
space:
mode:
authorJoey Hess2016-03-28 02:28:08 -0400
committerJoey Hess2016-03-28 02:28:08 -0400
commit67f4a35f08caff9efd5ec930943a02217188cc79 (patch)
tree5b1a9a5ba2dbdcd7897d65ccfeb8fd702f54266f /src/Propellor/Types/OS.hs
parentaf7b2d61c0c7f9b4fe53d8f5d18b5426a93cbd7b (diff)
implemented pickOS
Fell down the fromSing rabbit hole, followed by the OMH ghc doesh't work rabbit hole. Suboptimal.
Diffstat (limited to 'src/Propellor/Types/OS.hs')
-rw-r--r--src/Propellor/Types/OS.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Propellor/Types/OS.hs b/src/Propellor/Types/OS.hs
index 84c9d87b..d7df5490 100644
--- a/src/Propellor/Types/OS.hs
+++ b/src/Propellor/Types/OS.hs
@@ -17,6 +17,7 @@ module Propellor.Types.OS (
userGroup,
Port(..),
fromPort,
+ systemToTargetOS,
) where
import Network.BSD (HostName)
@@ -39,7 +40,12 @@ data TargetOS
= OSDebian
| OSBuntish
| OSFreeBSD
- deriving (Show, Eq)
+ deriving (Show, Eq, Ord)
+
+systemToTargetOS :: System -> TargetOS
+systemToTargetOS (System (Debian _) _) = OSDebian
+systemToTargetOS (System (Buntish _) _) = OSBuntish
+systemToTargetOS (System (FreeBSD _) _) = OSFreeBSD
-- | Debian has several rolling suites, and a number of stable releases,
-- such as Stable "jessie".