Skip to content
Snippets Groups Projects
Commit 8520d9e6 authored by Simon McVittie's avatar Simon McVittie
Browse files

populate-depot: Remove destination for dpkg-source before unpacking


This makes it idempotent.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 8c746cca
No related branches found
No related tags found
No related merge requests found
...@@ -471,20 +471,26 @@ class Main: ...@@ -471,20 +471,26 @@ class Main:
name = f['name'] name = f['name']
if name.endswith('.dsc'): if name.endswith('.dsc'):
dest = os.path.join(
self.unpack_sources_into,
runtime.name,
stanza['package'],
)
with suppress(FileNotFoundError):
logger.info('Removing %r', dest)
shutil.rmtree(dest)
subprocess.run( subprocess.run(
[ [
'dpkg-source', 'dpkg-source',
'-x', '-x',
dest,
os.path.join( os.path.join(
runtime.path, runtime.path,
'sources', 'sources',
f['name'], f['name'],
), ),
os.path.join(
self.unpack_sources_into,
runtime.name,
stanza['package'],
),
], ],
check=True, check=True,
) )
...@@ -537,16 +543,22 @@ class Main: ...@@ -537,16 +543,22 @@ class Main:
name = f['name'] name = f['name']
if name.endswith('.dsc'): if name.endswith('.dsc'):
dest = os.path.join(
self.unpack_sources_into,
runtime.name,
stanza['package'],
)
with suppress(FileNotFoundError):
logger.info('Removing %r', dest)
shutil.rmtree(dest)
subprocess.run( subprocess.run(
[ [
'dpkg-source', 'dpkg-source',
'-x', '-x',
os.path.join(tmp, 'sources', name), os.path.join(tmp, 'sources', name),
os.path.join( dest,
self.unpack_sources_into,
runtime.name,
stanza['package'],
),
], ],
check=True, check=True,
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment