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

Mark Wielaard mjw at redhat.com
Tue Jun 14 15:07:10 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 | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh
index 8de7bad..f02b6dc 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
 
@@ -286,7 +289,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
@@ -296,7 +299,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.
-- 
2.5.5



More information about the Rpm-maint mailing list