[Rpm-maint] [PATCH] Don't use hardcoded paths to tools/scripts in find-debuginfo.sh.

Mark Wielaard mjw at redhat.com
Thu Jun 9 11:13:21 UTC 2016


This prevents installation and testing in any other location than
/usr/lib/rpm.

Signed-off-by: Mark Wielaard <mjw at redhat.com>
---
 scripts/find-debuginfo.sh | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh
index 0fbeb9b..c93b246 100644
--- a/scripts/find-debuginfo.sh
+++ b/scripts/find-debuginfo.sh
@@ -29,6 +29,9 @@
 # All file names in switches are relative to builddir (. if not given).
 #
 
+# Figure out where we are installed so we can call other helper scripts.
+lib_rpm_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
 # With -g arg, pass it to strip on libraries or executables.
 strip_g=false
 
@@ -235,7 +238,7 @@ while read nlinks inum f; do
   fi
 
   echo "extracting debug info from $f"
-  id=$(/usr/lib/rpm/debugedit -b "$RPM_BUILD_DIR" -d /usr/src/debug \
+  id=$(${lib_rpm_dir}/debugedit -b "$RPM_BUILD_DIR" -d /usr/src/debug \
 			      -i -l "$SOURCEFILE" "$f") || exit
   if [ $nlinks -gt 1 ]; then
     eval linkedid_$inum=\$id
@@ -245,7 +248,7 @@ while read nlinks inum f; do
     $strict && exit 2
   fi
 
-  [ -x /usr/bin/gdb-add-index ] && /usr/bin/gdb-add-index "$f" > /dev/null 2>&1
+  [ type gdb-add-index >/dev/null 2>&1 && gdb-add-index "$f" > /dev/null 2>&1
 
   # A binary already copied into /usr/lib/debug doesn't get stripped,
   # just has its file names collected and adjusted.
@@ -300,7 +303,7 @@ if $run_dwz && type dwz >/dev/null 2>&1 \
     # dwz invalidates .gnu_debuglink CRC32 in the main files.
     cat "$ELFBINSFILE" |
     (cd "$RPM_BUILD_ROOT"; \
-     xargs -d '\n' /usr/lib/rpm/sepdebugcrcfix usr/lib/debug)
+     xargs -d '\n' ${lib_rpm_dir}/sepdebugcrcfix usr/lib/debug)
   fi
 fi
 
-- 
2.5.5



More information about the Rpm-maint mailing list