diff options
| author | Joey Hess <joeyh@joeyh.name> | 2016-03-27 01:27:42 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2016-03-27 01:28:18 -0400 |
| commit | 448d2c185e8d5d1da95113844f1b6d15d10883f6 (patch) | |
| tree | f27095003550420cf1fa37a96148c8a391abdc94 /src | |
| parent | 3deb3a622eec5e12dfaee320faaeb12c70f9c8d0 (diff) | |
refactor
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Types.hs | 2 | ||||
| -rw-r--r-- | src/Propellor/Types/MetaTypes.hs | 13 | ||||
| -rw-r--r-- | src/Propellor/Types/OS.hs | 13 |
3 files changed, 16 insertions, 12 deletions
diff --git a/src/Propellor/Types.hs b/src/Propellor/Types.hs index 5d6a37cc..d5959cbb 100644 --- a/src/Propellor/Types.hs +++ b/src/Propellor/Types.hs @@ -16,7 +16,7 @@ module Propellor.Types , Desc , MetaType(..) , MetaTypes - , OS(..) + , TargetOS(..) , UnixLike , Linux , DebianLike diff --git a/src/Propellor/Types/MetaTypes.hs b/src/Propellor/Types/MetaTypes.hs index 6033ec27..ce2b1411 100644 --- a/src/Propellor/Types/MetaTypes.hs +++ b/src/Propellor/Types/MetaTypes.hs @@ -2,7 +2,6 @@ module Propellor.Types.MetaTypes ( MetaType(..), - OS(..), UnixLike, Linux, DebianLike, @@ -26,15 +25,11 @@ module Propellor.Types.MetaTypes ( EqT, ) where -data MetaType - = Targeting OS -- ^ A target OS of a Property - | WithInfo -- ^ Indicates that a Property has associated Info +import Propellor.Types.OS -data OS - = OSDebian - | OSBuntish -- ^ A well-known Debian derivative founded by a space tourist. The actual name of this distribution is not used in Propellor per <http://joeyh.name/blog/entry/trademark_nonsense/> - | OSFreeBSD - deriving (Show, Eq) +data MetaType + = Targeting TargetOS -- ^ A target OS of a Property + | WithInfo -- ^ Indicates that a Property has associated Info -- | Any unix-like system type UnixLike = MetaTypes '[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish, 'Targeting 'OSFreeBSD ] diff --git a/src/Propellor/Types/OS.hs b/src/Propellor/Types/OS.hs index 94a37936..84c9d87b 100644 --- a/src/Propellor/Types/OS.hs +++ b/src/Propellor/Types/OS.hs @@ -3,6 +3,7 @@ module Propellor.Types.OS ( System(..), Distribution(..), + TargetOS(..), DebianSuite(..), FreeBSDRelease(..), FBSDVersion(..), @@ -32,6 +33,14 @@ data Distribution | FreeBSD FreeBSDRelease deriving (Show, Eq) +-- | Properties can target one or more OS's; the targets are part +-- of the type of the property, so need to be kept fairly simple. +data TargetOS + = OSDebian + | OSBuntish + | OSFreeBSD + deriving (Show, Eq) + -- | Debian has several rolling suites, and a number of stable releases, -- such as Stable "jessie". data DebianSuite = Experimental | Unstable | Testing | Stable Release @@ -39,10 +48,10 @@ data DebianSuite = Experimental | Unstable | Testing | Stable Release -- | FreeBSD breaks their releases into "Production" and "Legacy". data FreeBSDRelease = FBSDProduction FBSDVersion | FBSDLegacy FBSDVersion - deriving (Show, Eq) + deriving (Show, Eq) data FBSDVersion = FBSD101 | FBSD102 | FBSD093 - deriving (Eq) + deriving (Eq) instance IsString FBSDVersion where fromString "10.1-RELEASE" = FBSD101 |
