Skip to content

Commit

Permalink
Revert "Binary caching: remove symlinks, copy files instead (spack#9747
Browse files Browse the repository at this point in the history
…)"

This reverts commit 058cf81.
  • Loading branch information
Ubuntu authored and JBlaschke committed Jun 1, 2020
1 parent 236966b commit 025fe0a
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions lib/spack/spack/binary_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,18 +327,8 @@ def build_tarball(spec, outdir, force=False, rel=False, unsigned=False,
raise NoOverwriteException(url_util.format(remote_specfile_path))

# make a copy of the install directory to work with
workdir = os.path.join(tmpdir, os.path.basename(spec.prefix))
# install_tree copies hardlinks
# create a temporary tarfile from prefix and exract it to workdir
# tarfile preserves hardlinks
temp_tarfile_name = tarball_name(spec, '.tar')
temp_tarfile_path = os.path.join(tarfile_dir, temp_tarfile_name)
with closing(tarfile.open(temp_tarfile_path, 'w')) as tar:
tar.add(name='%s' % spec.prefix,
arcname='.')
with closing(tarfile.open(temp_tarfile_path, 'r')) as tar:
tar.extractall(workdir)
os.remove(temp_tarfile_path)
workdir = os.path.join(tempfile.mkdtemp(), os.path.basename(spec.prefix))
install_tree(spec.prefix, workdir, symlinks=True)

# create info for later relocation and create tar
write_buildinfo_file(spec.prefix, workdir, rel=rel)
Expand Down Expand Up @@ -878,8 +868,8 @@ def get_keys(install=False, trust=False, force=False):
tty.msg("Finding public keys in %s" % mirror_dir)
files = os.listdir(str(mirror_dir))
for file in files:
if re.search(r'\.key', file) or re.search(r'\.pub', file):
link = url_util.join(fetch_url_build_cache, file)
if re.search('\.key', file):
link = 'file://' + mirror + '/' + file
keys.add(link)
else:
tty.msg("Finding public keys at %s" %
Expand All @@ -889,7 +879,7 @@ def get_keys(install=False, trust=False, force=False):
url_util.join(fetch_url_build_cache, 'index.html'))

for link in links:
if re.search(r'\.key', link) or re.search(r'\.pub', link):
if re.search("\.key", link):
keys.add(link)

for link in keys:
Expand Down

0 comments on commit 025fe0a

Please sign in to comment.