summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2016-06-14 17:07:10 +0200
committerPanu Matilainen <pmatilai@redhat.com>2016-11-02 07:43:42 +0200
commit54d30ac4a344770571e56c60281a9130b61c1788 (patch)
treeec5f53bd63576c613f49e382b1a64b4f6ff7a6b4
parent7495d179b63a191eadcdb55b8ec3e404e661f510 (diff)
downloadrpm-54d30ac4a344770571e56c60281a9130b61c1788.tar.gz
Don't use hardcoded paths to tools/scripts in find-debuginfo.sh.
This prevents installation and testing in any other location than /usr/lib/rpm. Signed-off-by: Mark Wielaard <mjw@redhat.com> (cherry picked from commit 41c4dcf507e2208585d6dc0952f59686a3a69d69)
-rw-r--r--scripts/find-debuginfo.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh
index 6aaf21692..a70ef3c99 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
@@ -299,7 +302,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
@@ -309,7 +312,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.