Skip to content

Commit

Permalink
tests/docker: fix copying of executable in "update"
Browse files Browse the repository at this point in the history
We have the same symlink chasing problem when doing an "update"
operation. Fix that.

Based-on: 5e33f7f ("tests/docker: better handle symlinked libs")
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Message-Id: <20210512102051.12134-3-alex.bennee@linaro.org>
  • Loading branch information
stsquad committed May 18, 2021
1 parent 367196c commit 3218d82
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/docker/docker.py
Expand Up @@ -548,7 +548,14 @@ def run(self, args, argv):
libs = _get_so_libs(args.executable)
if libs:
for l in libs:
tmp_tar.add(os.path.realpath(l), arcname=l)
so_path = os.path.dirname(l)
name = os.path.basename(l)
real_l = os.path.realpath(l)
try:
tmp_tar.add(real_l, arcname="%s/%s" % (so_path, name))
except FileNotFoundError:
print("Couldn't add %s/%s to archive" % (so_path, name))
pass

# Create a Docker buildfile
df = StringIO()
Expand Down

0 comments on commit 3218d82

Please sign in to comment.