GCS: extract tarfile if the content is tarfile

Bug: b/324418194
Change-Id: I207f5352a7d00d5bf7a7587dfa60f216adeef7ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5346335
Commit-Queue: Stephanie Kim <kimstephanie@google.com>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
changes/35/5346335/2
Stephanie Kim 1 year ago committed by LUCI CQ
parent 63ae5028c1
commit f7eb78f95c

@ -2630,8 +2630,9 @@ class GcsDependency(Dependency):
calculated=calculated_sha256sum,
))
with tarfile.open(output_file, 'r:*') as tar:
tar.extractall(path=output_dir)
if tarfile.is_tarfile(output_file):
with tarfile.open(output_file, 'r:*') as tar:
tar.extractall(path=output_dir)
self.WriteFilenameHash(calculated_sha256sum, hash_file)
#override

Loading…
Cancel
Save