Bug 1484790 - [fetches] Overwrite without prompting when unzipping an artifact with fetch-content, r=gps

This also moves the call to 'fetch_artifacts' in run-task down inside the
try/finally block. This way if something goes wrong, we'll still cleanup
MOZ_FETCHES_DIR.

Differential Revision: https://phabricator.services.mozilla.com/D4152

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrew Halberstadt 2018-08-24 16:04:59 +00:00
Родитель a9a7cfd9fa
Коммит 321a8788f2
2 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -191,7 +191,7 @@ def extract_archive(path, dest_dir, typ):
elif typ == 'zip':
# unzip from stdin has wonky behavior. We don't use a pipe for it.
ifh = open(os.devnull, 'rb')
args = ['unzip', str(path)]
args = ['unzip', '-o', str(path)]
pipe_stdin = False
else:
raise ValueError('unknown archive format: %s' % path)

Просмотреть файл

@ -737,11 +737,11 @@ def main(args):
print('task should be defined in terms of non-symbolic revision')
return 1
fetches = os.environ.get('MOZ_FETCHES')
if fetches:
fetch_artifacts(fetches)
try:
fetches = os.environ.get('MOZ_FETCHES')
if fetches:
fetch_artifacts(fetches)
return run_and_prefix_output(b'task', task_args)
finally:
fetches_dir = os.environ.get('MOZ_FETCHES_DIR')