aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-01-09 19:31:28 +0100
committerGuido Günther <agx@sigxcpu.org>2017-01-09 19:36:23 +0100
commite9ffa80e5ff429e6f5cd38c07036aae07416fecf (patch)
treec639cca0fabf0078517e2f51c3147197a407bc1d
parent783c1d5c7b9e0f152509b9a472a007444effda65 (diff)
buildpackage: use os.makedirs to create export dirs
Thanks: Andrea Zagli for the suggestion
-rwxr-xr-xgbp/scripts/buildpackage.py4
-rw-r--r--tests/component/deb/test_buildpackage.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/gbp/scripts/buildpackage.py b/gbp/scripts/buildpackage.py
index d431c4c..6524f01 100755
--- a/gbp/scripts/buildpackage.py
+++ b/gbp/scripts/buildpackage.py
@@ -178,7 +178,7 @@ def export_source(repo, tree, source, options, dest_dir, tarball_dir):
def move_old_export(target):
"""move a build tree away if it exists"""
try:
- os.mkdir(target)
+ os.makedirs(target)
except OSError as e:
if e.errno == errno.EEXIST:
os.rename(target, "%s.obsolete.%s" % (target, time.time()))
@@ -231,7 +231,7 @@ def prepare_output_dir(dir):
output_dir = os.path.abspath(dir or '..')
try:
- os.mkdir(output_dir)
+ os.makedirs(output_dir)
except OSError as e:
if e.errno != errno.EEXIST:
raise GbpError("Cannot create output dir %s" % output_dir)
diff --git a/tests/component/deb/test_buildpackage.py b/tests/component/deb/test_buildpackage.py
index 74d1fbb..822f200 100644
--- a/tests/component/deb/test_buildpackage.py
+++ b/tests/component/deb/test_buildpackage.py
@@ -147,6 +147,6 @@ class TestBuildpackage(ComponentTestBase):
self._test_buildpackage('hello-debhelper',
'dsc-3.0',
'2.8-1',
- ['--git-export-dir=../foo'],
+ ['--git-export-dir=../foo/bar'],
)
- ok_(os.path.exists('../foo'))
+ ok_(os.path.exists('../foo/bar'))