summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-02-03 15:04:35 +0000
committerCarl Hetherington <cth@carlh.net>2016-02-03 15:04:35 +0000
commit1bfc5eb4180a5647c549411d9119fbcbdc6045aa (patch)
tree93fe6d953033cec5bf26df1dd8e28f79462526e9
parent0e5b5bf1aa5a06065467e661331d41576d73c386 (diff)
Support arch in host target.
-rwxr-xr-xcdist15
1 files changed, 9 insertions, 6 deletions
diff --git a/cdist b/cdist
index 6c74041..adb19c6 100755
--- 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':