From 321a8788f23dc688a1a1017b605bddd12e42415c Mon Sep 17 00:00:00 2001 From: Andrew Halberstadt Date: Fri, 24 Aug 2018 16:04:59 +0000 Subject: [PATCH] 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 --- taskcluster/scripts/misc/fetch-content | 2 +- taskcluster/scripts/run-task | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/taskcluster/scripts/misc/fetch-content b/taskcluster/scripts/misc/fetch-content index bedabaa82150..2051cf9c2d2e 100755 --- a/taskcluster/scripts/misc/fetch-content +++ b/taskcluster/scripts/misc/fetch-content @@ -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) diff --git a/taskcluster/scripts/run-task b/taskcluster/scripts/run-task index 5f654332b86a..b87639c9d018 100755 --- a/taskcluster/scripts/run-task +++ b/taskcluster/scripts/run-task @@ -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')