diff options
author | Guido Günther <agx@sigxcpu.org> | 2016-07-03 17:52:28 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2016-07-04 14:09:58 +0200 |
commit | 7621268d39080f467f30465f4955b7c85fe37bca (patch) | |
tree | 91aa830abccb7444c06dbf863a1af01534c6196d /gbp/deb/upstreamsource.py | |
parent | aaa800e9097c791b0f69a3b17ae0a7385f12c0c9 (diff) |
unpack_subtarball: Remove existing directory first
so consecutive imports work
Git-Dch: Ignore
Diffstat (limited to 'gbp/deb/upstreamsource.py')
-rw-r--r-- | gbp/deb/upstreamsource.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gbp/deb/upstreamsource.py b/gbp/deb/upstreamsource.py index 76f85b4..651043e 100644 --- a/gbp/deb/upstreamsource.py +++ b/gbp/deb/upstreamsource.py @@ -46,8 +46,10 @@ def unpack_subtarball(dest, component, tarball, filters): source = DebianUpstreamSource(tarball) source.unpack(tmpdir, filters) - dest = os.path.join(dest, component) - shutil.move(source.unpacked, dest) + newdest = os.path.join(dest, component) + if os.path.exists(newdest): + shutil.rmtree(newdest) + shutil.move(source.unpacked, newdest) finally: os.chdir(olddir) if tmpdir is not None: |