1 |
commit: 583af0f01ece9c63042a8a12bac11aaa53faa19b |
2 |
Author: Mike Frysinger <vapier <AT> chromium <DOT> org> |
3 |
AuthorDate: Fri Apr 16 14:37:46 2021 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Apr 16 14:37:46 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=583af0f0 |
7 |
|
8 |
lddtree: handle ${ORIGIN} like $ORIGIN |
9 |
|
10 |
Bug: https://bugs.gentoo.org/653586 |
11 |
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org> |
12 |
|
13 |
lddtree.py | 2 ++ |
14 |
lddtree.sh | 2 +- |
15 |
2 files changed, 3 insertions(+), 1 deletion(-) |
16 |
|
17 |
diff --git a/lddtree.py b/lddtree.py |
18 |
index fae39e0..cd068f6 100755 |
19 |
--- a/lddtree.py |
20 |
+++ b/lddtree.py |
21 |
@@ -207,6 +207,8 @@ def ParseLdPaths(str_ldpaths, root='', path=None): |
22 |
ldpath = os.getcwd() |
23 |
elif '$ORIGIN' in ldpath: |
24 |
ldpath = ldpath.replace('$ORIGIN', os.path.dirname(path)) |
25 |
+ elif '${ORIGIN}' in ldpath: |
26 |
+ ldpath = ldpath.replace('${ORIGIN}', os.path.dirname(path)) |
27 |
else: |
28 |
ldpath = root + ldpath |
29 |
ldpaths.append(normpath(ldpath)) |
30 |
|
31 |
diff --git a/lddtree.sh b/lddtree.sh |
32 |
index b05ce19..5271dae 100755 |
33 |
--- a/lddtree.sh |
34 |
+++ b/lddtree.sh |
35 |
@@ -73,7 +73,7 @@ find_elf() { |
36 |
if [[ ${c_last_needed_by} != ${needed_by} ]] ; then |
37 |
c_last_needed_by=${needed_by} |
38 |
c_last_needed_by_rpaths=$(scanelf -qF '#F%r' "${needed_by}" | \ |
39 |
- sed -e 's|:| |g' -e "s:[$]ORIGIN:${needed_by%/*}:") |
40 |
+ sed -E -e 's|:| |g' -e "s:[$](ORIGIN|\{ORIGIN\}):${needed_by%/*}:") |
41 |
fi |
42 |
check_paths "${elf}" ${c_last_needed_by_rpaths} && return 0 |