Commit 26bee44d authored by Rakib Hasan's avatar Rakib Hasan Committed by LUCI CQ

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/+/3287293Reviewed-by: 's avatarGavin Mak <gavinmak@google.com>
Commit-Queue: Rakib Hasan <rmhasan@google.com>
parent 2efe3d74
......@@ -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:
......
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