Support arch in host target.
authorCarl Hetherington <cth@carlh.net>
Wed, 3 Feb 2016 15:04:35 +0000 (15:04 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 3 Feb 2016 15:04:35 +0000 (15:04 +0000)
cdist

diff --git a/cdist b/cdist
index 6c740419c07c6a4fb3d838c966b77664e58d58de..adb19c634b19bbf5a4964099978c09b4189c0837 100755 (executable)
--- a/cdist
+++ b/cdist
@@ -551,16 +551,19 @@ def target_factory(s, debug, work):
     elif s == 'raspbian':
         target = ChrootTarget(s, None, None, work)
     elif s == 'host':
+        l = f.readline().strip().split()
+        if command_and_read('uname -m').read().strip() == 'x86_64':
+            bits = 64
+        else:
+            bits = 32
         try:
             f = open('/etc/fedora-release', 'r')
-            l = f.readline().strip().split()
-            if command_and_read('uname -m').read().strip() == 'x86_64':
-                bits = 64
-            else:
-                bits = 32
             target = HostTarget("fedora", l[2], bits, work)
         except Exception as e:
-            raise Error("could not identify distribution for `host' target (%s)" % e)
+            if os.path.exists('/etc/arch-release'):
+                target = HostTarget("arch", None, l[2], bits, work)
+            else:
+                raise Error("could not identify distribution for `host' target (%s)" % e)
     elif s.startswith('osx-'):
         target = OSXSingleTarget(int(s.split('-')[1]), work)
     elif s == 'osx':