diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-04-22 11:59:56 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-04-22 11:59:56 +0100 |
| commit | 5e0a0162fe831471585288874b09e46acdd26ef2 (patch) | |
| tree | 4a7fc7d15f81a880bc25120a143ed918b6e6f625 | |
| parent | 6a48a5a3f4c492150d95d1f07468664ddf5dc54e (diff) | |
Try to cope with multiple packages.
| -rwxr-xr-x | cdist | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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() |
