commit:     583af0f01ece9c63042a8a12bac11aaa53faa19b
Author:     Mike Frysinger <vapier <AT> chromium <DOT> org>
AuthorDate: Fri Apr 16 14:37:46 2021 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Apr 16 14:37:46 2021 +0000
URL:        https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=583af0f0

lddtree: handle ${ORIGIN} like $ORIGIN

Bug: https://bugs.gentoo.org/653586
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

 lddtree.py | 2 ++
 lddtree.sh | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/lddtree.py b/lddtree.py
index fae39e0..cd068f6 100755
--- a/lddtree.py
+++ b/lddtree.py
@@ -207,6 +207,8 @@ def ParseLdPaths(str_ldpaths, root='', path=None):
             ldpath = os.getcwd()
         elif '$ORIGIN' in ldpath:
             ldpath = ldpath.replace('$ORIGIN', os.path.dirname(path))
+        elif '${ORIGIN}' in ldpath:
+            ldpath = ldpath.replace('${ORIGIN}', os.path.dirname(path))
         else:
             ldpath = root + ldpath
         ldpaths.append(normpath(ldpath))

diff --git a/lddtree.sh b/lddtree.sh
index b05ce19..5271dae 100755
--- a/lddtree.sh
+++ b/lddtree.sh
@@ -73,7 +73,7 @@ find_elf() {
                if [[ ${c_last_needed_by} != ${needed_by} ]] ; then
                        c_last_needed_by=${needed_by}
                        c_last_needed_by_rpaths=$(scanelf -qF '#F%r' 
"${needed_by}" | \
-                               sed -e 's|:| |g' -e 
"s:[$]ORIGIN:${needed_by%/*}:")
+                               sed -E -e 's|:| |g' -e 
"s:[$](ORIGIN|\{ORIGIN\}):${needed_by%/*}:")
                fi
                check_paths "${elf}" ${c_last_needed_by_rpaths} && return 0
 

Reply via email to