summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Gartung <gartung@fnal.gov>2020-03-09 16:46:54 -0500
committerGitHub <noreply@github.com>2020-03-09 16:46:54 -0500
commitc7dda38826b4f4f7027407e5b95aecc5d8129f72 (patch)
tree09ce8fa379541eadafa3292f2e18aff1f05e2e5e
parentfd69994c680773e28ae473e2be8664355dbf448b (diff)
downloadspack-c7dda38826b4f4f7027407e5b95aecc5d8129f72.tar.gz
spack-c7dda38826b4f4f7027407e5b95aecc5d8129f72.tar.bz2
spack-c7dda38826b4f4f7027407e5b95aecc5d8129f72.tar.xz
spack-c7dda38826b4f4f7027407e5b95aecc5d8129f72.zip
Revert to gzip as the default buildcache compression as bzip2 is not always available. (#15412)
* Revert to gzip as the default buildcache compression as bzip2 is not always available. * Flake8
-rw-r--r--lib/spack/spack/binary_distribution.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/spack/spack/binary_distribution.py b/lib/spack/spack/binary_distribution.py
index f2a01e6b21..0569bcc665 100644
--- a/lib/spack/spack/binary_distribution.py
+++ b/lib/spack/spack/binary_distribution.py
@@ -308,7 +308,7 @@ def build_tarball(spec, outdir, force=False, rel=False, unsigned=False,
tmpdir = tempfile.mkdtemp()
cache_prefix = build_cache_prefix(tmpdir)
- tarfile_name = tarball_name(spec, '.tar.bz2')
+ tarfile_name = tarball_name(spec, '.tar.gz')
tarfile_dir = os.path.join(cache_prefix, tarball_directory_name(spec))
tarfile_path = os.path.join(tarfile_dir, tarfile_name)
spackfile_path = os.path.join(
@@ -377,8 +377,8 @@ def build_tarball(spec, outdir, force=False, rel=False, unsigned=False,
shutil.rmtree(tmpdir)
tty.die(e)
- # create compressed tarball of the install prefix
- with closing(tarfile.open(tarfile_path, 'w:bz2')) as tar:
+ # create gzip compressed tarball of the install prefix
+ with closing(tarfile.open(tarfile_path, 'w:gz')) as tar:
tar.add(name='%s' % workdir,
arcname='%s' % os.path.basename(spec.prefix))
# remove copy of install directory
@@ -592,16 +592,16 @@ def extract_tarball(spec, filename, allow_root=False, unsigned=False,
stagepath = os.path.dirname(filename)
spackfile_name = tarball_name(spec, '.spack')
spackfile_path = os.path.join(stagepath, spackfile_name)
- tarfile_name = tarball_name(spec, '.tar.bz2')
+ tarfile_name = tarball_name(spec, '.tar.gz')
tarfile_path = os.path.join(tmpdir, tarfile_name)
specfile_name = tarball_name(spec, '.spec.yaml')
specfile_path = os.path.join(tmpdir, specfile_name)
with closing(tarfile.open(spackfile_path, 'r')) as tar:
tar.extractall(tmpdir)
- # older buildcache tarfiles use gzip compression
+ # some buildcache tarfiles use bzip2 compression
if not os.path.exists(tarfile_path):
- tarfile_name = tarball_name(spec, '.tar.gz')
+ tarfile_name = tarball_name(spec, '.tar.bz2')
tarfile_path = os.path.join(tmpdir, tarfile_name)
if not unsigned:
if os.path.exists('%s.asc' % specfile_path):