Update the regex used for searching for ETag's in gsutil's output

The ETag's for some of the crx files contain non alpha
and non digit characters like '='.

Bug:1225491
Bug:b/191630810
Change-Id: Id43ed8ea5fc17825731dd1605c7d6358ceed39cd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3287293
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Rakib Hasan <rmhasan@google.com>
changes/93/3287293/5
Rakib Hasan 3 years ago committed by LUCI CQ
parent 2efe3d74ba
commit 26bee44dc2

@ -84,11 +84,11 @@ def _upload_worker(
if gsutil.check_call('ls', file_url)[0] == 0 and not force:
# File exists, check MD5 hash.
_, out, _ = gsutil.check_call_with_retries('ls', '-L', file_url)
etag_match = re.search(r'ETag:\s+([a-z0-9]{32})', out)
etag_match = re.search(r'ETag:\s+\S+', out)
if etag_match:
stdout_queue.put(
'%d> File with url %s already exists' % (thread_num, file_url))
remote_md5 = etag_match.group(1)
remote_md5 = etag_match.group(0).split()[1]
# Calculate the MD5 checksum to match it to Google Storage's ETag.
with md5_lock:
if use_md5:

Loading…
Cancel
Save