Skip to content
Snippets Groups Projects
Commit 058cf813 authored by Peter Scheibel's avatar Peter Scheibel Committed by Greg Becker
Browse files

Binary caching: remove symlinks, copy files instead (#9747)

* omit symlinks and create file copies when making a binary cache of a package

* unrelated flake edits involving regexes that recent flake is now angry about
parent 30eda8b8
No related branches found
No related tags found
No related merge requests found
...@@ -269,7 +269,9 @@ def build_tarball(spec, outdir, force=False, rel=False, unsigned=False, ...@@ -269,7 +269,9 @@ def build_tarball(spec, outdir, force=False, rel=False, unsigned=False,
raise NoOverwriteException(str(specfile_path)) raise NoOverwriteException(str(specfile_path))
# make a copy of the install directory to work with # make a copy of the install directory to work with
workdir = os.path.join(tempfile.mkdtemp(), os.path.basename(spec.prefix)) workdir = os.path.join(tempfile.mkdtemp(), os.path.basename(spec.prefix))
install_tree(spec.prefix, workdir, symlinks=True) # set symlinks=False here to avoid broken symlinks when archiving and
# moving the package
install_tree(spec.prefix, workdir, symlinks=False)
# create info for later relocation and create tar # create info for later relocation and create tar
write_buildinfo_file(spec.prefix, workdir, rel=rel) write_buildinfo_file(spec.prefix, workdir, rel=rel)
...@@ -586,14 +588,14 @@ def get_keys(install=False, trust=False, force=False): ...@@ -586,14 +588,14 @@ def get_keys(install=False, trust=False, force=False):
tty.msg("Finding public keys in %s" % mirror) tty.msg("Finding public keys in %s" % mirror)
files = os.listdir(mirror) files = os.listdir(mirror)
for file in files: for file in files:
if re.search('\.key', file): if re.search(r'\.key', file):
link = 'file://' + mirror + '/' + file link = 'file://' + mirror + '/' + file
keys.add(link) keys.add(link)
else: else:
tty.msg("Finding public keys on %s" % url) tty.msg("Finding public keys on %s" % url)
p, links = spider(url + "/build_cache", depth=1) p, links = spider(url + "/build_cache", depth=1)
for link in links: for link in links:
if re.search("\.key", link): if re.search(r'\.key', link):
keys.add(link) keys.add(link)
for link in keys: for link in keys:
with Stage(link, name="build_cache", keep=True) as stage: with Stage(link, name="build_cache", keep=True) as stage:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment