[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 02/13] tests/docker: better handle symlinked libs
From: |
Alex Bennée |
Subject: |
[PATCH v1 02/13] tests/docker: better handle symlinked libs |
Date: |
Fri, 24 Jan 2020 20:40:15 +0000 |
When we are copying we want to ensure we grab the first
resolution (the found in path section). However even that binary might
be a symlink so lets make sure we chase the symlinks to copy the right
binary to where it can be found.
Signed-off-by: Alex Bennée <address@hidden>
---
tests/docker/docker.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index 31d8adf836..7dfca63fe4 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -109,7 +109,7 @@ def _get_so_libs(executable):
ensure theright data is copied."""
libs = []
- ldd_re = re.compile(r"(/.*/)(\S*)")
+ ldd_re = re.compile(r"(?:\S+ => )?(\S*) \(:?0x[0-9a-f]+\)")
try:
ldd_output = subprocess.check_output(["ldd",
executable]).decode('utf-8')
for line in ldd_output.split("\n"):
@@ -145,7 +145,8 @@ def _copy_binary_with_libs(src, bin_dest, dest_dir):
if libs:
for l in libs:
so_path = os.path.dirname(l)
- _copy_with_mkdir(l, dest_dir, so_path)
+ real_l = os.path.realpath(l)
+ _copy_with_mkdir(real_l, dest_dir, so_path)
def _check_binfmt_misc(executable):
--
2.20.1
- [PATCH v1 00/13] docker multiarch awareness, Alex Bennée, 2020/01/24
- [PATCH v1 03/13] gitlab-ci: Refresh the list of iotests, Alex Bennée, 2020/01/24
- [PATCH v1 04/13] travis.yml: Install genisoimage package, Alex Bennée, 2020/01/24
- [PATCH v1 01/13] tests/docker: move most cross compilers to buster base, Alex Bennée, 2020/01/24
- [PATCH v1 02/13] tests/docker: better handle symlinked libs,
Alex Bennée <=
- [PATCH v1 05/13] .shippable: --disable-docs for cross-compile tests, Alex Bennée, 2020/01/24
- [PATCH v1 06/13] tests/docker: move all cross-compilers images into dockerfiles.cross, Alex Bennée, 2020/01/24
- [PATCH v1 07/13] tests/docker: move all multiarch containers into dockerfiles.multiarch, Alex Bennée, 2020/01/24
- [PATCH v1 08/13] tests/docker: search the tests/docker tree to inline parent dockerfile, Alex Bennée, 2020/01/24
- [PATCH v1 10/13] tests/docker: add debian10-native-qemu-build, Alex Bennée, 2020/01/24
- [PATCH v1 09/13] tests/docker: switch to multiarch aware container support, Alex Bennée, 2020/01/24
- [PATCH v1 13/13] tests/docker: enable cross-compilers for aarch64, Alex Bennée, 2020/01/24
- [PATCH v1 11/13] tests/docker: rename the cross builds, Alex Bennée, 2020/01/24