diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-07-12 15:26:59 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-07-12 15:26:59 +0100 |
| commit | 176272785f14d5eb045aea7d2943d4d1ab7998f3 (patch) | |
| tree | f4463ac2a15a1ea96cc39c4420ac2528469ea1cc | |
| parent | b6b0dc5e14fb5a8cbacf88a4d73d57de742d2e50 (diff) | |
Fix a couple of bits.
| -rwxr-xr-x | cdist | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -162,7 +162,11 @@ def makedirs(d): d includes a colon, otherwise locally. """ if d.find(':') == -1: - os.makedirs(d) + try: + os.makedirs(d) + except OSError as e: + if e.errno != 17: + raise e else: s = d.split(':') command('ssh %s -- mkdir -p %s' % (s[0], s[1])) @@ -350,8 +354,12 @@ class Target(object): tree = globals.trees.get(project, checkout, self) tree.build_dependencies() tree.build() - for p in tree.call('package', tree.version): - copyfile(p, os.path.join(output_dir, os.path.basename(devel_to_git(tree.git_commit, p)))) + packages = tree.call('package', tree.version) + if isinstance(packages, (str, unicode)): + copyfile(packages, os.path.join(output_dir, os.path.basename(devel_to_git(tree.git_commit, packages)))) + else: + for p in packages: + copyfile(p, os.path.join(output_dir, os.path.basename(devel_to_git(tree.git_commit, p)))) def test(self, tree, test): """test is the test case to run, or None""" |
