buildcache: Check for tar.bz2 and set tar.gz if not found (#15054)

* Check for tar.bz2 and set tar.gz if not found

* Move check for tarfile after it is extracted
This commit is contained in:
Patrick Gartung 2020-02-18 15:49:55 -06:00 committed by GitHub
parent 53238af2dc
commit 6f95967e95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -596,6 +596,10 @@ def extract_tarball(spec, filename, allow_root=False, unsigned=False,
with closing(tarfile.open(spackfile_path, 'r')) as tar:
tar.extractall(tmpdir)
# older buildcache tarfiles use gzip compression
if not os.path.exists(tarfile_path):
tarfile_name = tarball_name(spec, '.tar.gz')
tarfile_path = os.path.join(tmpdir, tarfile_name)
if not unsigned:
if os.path.exists('%s.asc' % specfile_path):
try: