summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-09-29 19:43:23 +0100
committerCarl Hetherington <cth@carlh.net>2015-09-29 19:43:23 +0100
commit1c70c735026f9f8b3042f963f390cdc81523c72c (patch)
treef5406a1c3f9b0f85717dc46c84054b09befa5acc
parenteb2c74a59c1071fc6571a2345de9a66bd05a1e4a (diff)
Hack.
-rwxr-xr-xcdist16
1 files changed, 11 insertions, 5 deletions
diff --git a/cdist b/cdist
index b2176fd..21f363e 100755
--- a/cdist
+++ b/cdist
@@ -542,11 +542,17 @@ def target_factory(s, debug, work):
target = ChrootTarget(p[0], p[1], int(p[2]), work)
elif s == 'raspbian':
target = ChrootTarget(s, None, None, work)
- elif s.startswith('fedora-'):
- p = s.split('-')
- if len(p) != 3:
- raise Error("Bad Linux target name `%s'; must be something like fedora-22-64 (i.e. distro-version-bits)" % s)
- target = HostTarget(p[0], p[1], int(p[2]), work)
+ elif s == 'host':
+ try:
+ f = open('/etc/fedora-release', 'r')
+ l = f.readline().strip().split()
+ if command_and_read('uname -m') == 'x86_64':
+ bits = 64
+ else:
+ bits = 32
+ target = HostTarget("fedora", l[2], bits, work)
+ except:
+ raise Error("could not identify distribution for `host' target")
elif s.startswith('osx-'):
target = OSXSingleTarget(int(s.split('-')[1]), work)
elif s == 'osx':