summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-04-22 11:59:56 +0100
committerCarl Hetherington <cth@carlh.net>2013-04-22 11:59:56 +0100
commit5e0a0162fe831471585288874b09e46acdd26ef2 (patch)
tree4a7fc7d15f81a880bc25120a143ed918b6e6f625
parent6a48a5a3f4c492150d95d1f07468664ddf5dc54e (diff)
Try to cope with multiple packages.
-rwxr-xr-xcdist12
1 files changed, 9 insertions, 3 deletions
diff --git a/cdist b/cdist
index f06a4f4..dbc03e3 100755
--- a/cdist
+++ b/cdist
@@ -408,16 +408,22 @@ elif args.command == 'package':
target = Target(args.target)
env = target.environment
- r = env.package(target, project)
+
+ packages = env.package(target, project)
+ if hasattr(packages, 'strip') or (not hasattr(packages, '__getitem__') and not hasattr(packages, '__iter__')):
+ packages = [packages]
+
if target.platform == 'linux':
out = '%s/%s-%d' % (args.output, target.version, target.bits)
try:
os.makedirs(out)
except:
pass
- copyfile(r, '%s/%s' % (out, os.path.basename(r)))
+ for p in packages:
+ copyfile(r, '%s/%s' % (out, os.path.basename(p)))
else:
- copyfile(r, '%s/%s' % (args.output, os.path.basename(r)))
+ for p in packages:
+ copyfile(r, '%s/%s' % (args.output, os.path.basename(p)))
env.cleanup()