summaryrefslogtreecommitdiff
path: root/src/Propellor/Types/OS.hs
diff options
context:
space:
mode:
authorFĂ©lix Sipma2016-05-24 12:57:44 +0200
committerJoey Hess2016-06-13 23:24:16 -0400
commit6b4432c5884d7187140d5fde771444f7c8301438 (patch)
tree602119ae6d239e59fc9b6679c9dc4d7308aea0e6 /src/Propellor/Types/OS.hs
parenta0ef4e9e957cd11c53df66ce2e8c3f8e716f5501 (diff)
convert Architecture to a sumtype
TODO: remove ANDROID (used in GitAnnexBuilder) TODO: add other architectures TODO: rename ARMHF TODO: rename ARMEL (cherry picked from commit 6f36f6cade4e1d8b15c714565e223562c6573099)
Diffstat (limited to 'src/Propellor/Types/OS.hs')
-rw-r--r--src/Propellor/Types/OS.hs17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/Propellor/Types/OS.hs b/src/Propellor/Types/OS.hs
index d7df5490..662983b2 100644
--- a/src/Propellor/Types/OS.hs
+++ b/src/Propellor/Types/OS.hs
@@ -9,7 +9,8 @@ module Propellor.Types.OS (
FBSDVersion(..),
isStable,
Release,
- Architecture,
+ Architecture(..),
+ architectureToDebianArchString,
HostName,
UserName,
User(..),
@@ -75,7 +76,19 @@ isStable (Stable _) = True
isStable _ = False
type Release = String
-type Architecture = String
+data Architecture = X86_64 | X86_32 | ARMHF | ARMEL | ANDROID
+ deriving (Show, Eq)
+-- TODO: remove ANDROID (used in GitAnnexBuilder)
+-- TODO: add other architectures
+-- TODO: rename ARMHF
+-- TODO: rename ARMEL
+
+architectureToDebianArchString :: Architecture -> String
+architectureToDebianArchString X86_64 = "amd64"
+architectureToDebianArchString X86_32 = "i386"
+architectureToDebianArchString ARMHF = "armhf"
+architectureToDebianArchString ARMEL = "armel"
+architectureToDebianArchString ANDROID = "android"
type UserName = String