Commit 6b6a1144 authored by hinoka@chromium.org's avatar hinoka@chromium.org

Delete before cp in download_from_google_storage

BUG=

Review URL: https://codereview.chromium.org/696023002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@292819 0039d316-1c4b-4281-b951-d872f2087c98
parent c6ef53a8
......@@ -236,8 +236,13 @@ def _downloader_worker_thread(thread_num, q, force, base_url,
file_url, output_filename)))
continue
# Fetch the file.
out_q.put('%d> Downloading %s...' % (
thread_num, output_filename))
out_q.put('%d> Downloading %s...' % (thread_num, output_filename))
try:
os.remove(output_filename) # Delete the file if it exists already.
except OSError:
if os.path.exists(output_filename):
out_q.put('%d> Warning: deleting %s failed.' % (
thread_num, output_filename))
code, _, err = gsutil.check_call('cp', '-q', file_url, output_filename)
if code != 0:
out_q.put('%d> %s' % (thread_num, err))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment