aboutsummaryrefslogtreecommitdiffstats
path: root/find-debuginfo.sh
diff options
context:
space:
mode:
authorGwenolé Beauchesne <gbeauchesne@mandriva.org>2006-01-04 13:43:08 +0000
committerGwenolé Beauchesne <gbeauchesne@mandriva.org>2006-01-04 13:43:08 +0000
commit154889050ed8a4b6d9685cb47a4f9e25779173f8 (patch)
tree5c78a7c6d8ff6641e7c44bbd28e84916d177460d /find-debuginfo.sh
parenta840159143376380c01491ecfadce9b157c8afac (diff)
downloadrpm-setup-154889050ed8a4b6d9685cb47a4f9e25779173f8.tar
rpm-setup-154889050ed8a4b6d9685cb47a4f9e25779173f8.tar.gz
rpm-setup-154889050ed8a4b6d9685cb47a4f9e25779173f8.tar.bz2
rpm-setup-154889050ed8a4b6d9685cb47a4f9e25779173f8.tar.xz
rpm-setup-154889050ed8a4b6d9685cb47a4f9e25779173f8.zip
preserve setuid/setgid permissions when stripping files for -debug package
Diffstat (limited to 'find-debuginfo.sh')
-rwxr-xr-xfind-debuginfo.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/find-debuginfo.sh b/find-debuginfo.sh
index 4900ff3..1ec4a18 100755
--- a/find-debuginfo.sh
+++ b/find-debuginfo.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#find-debuginfo.sh - automagically generate debug info and file list
#for inclusion in an rpm spec file.
@@ -20,6 +20,9 @@ EXCLUDE_REGEXP=`perl -e 'print "(", join("|", @ARGV), ")"' $EXCLUDE_FROM_STRIP`
for f in `find $RPM_BUILD_ROOT -path "${debugdir}" -prune -o -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
sed -n -e 's/^\(.*\):[ ]*.*ELF.* \(executable\|shared object\).*, not stripped/\1/p'`
do
+ [[ -n "$EXCLUDE_REGEXP" ]] && egrep -q "$EXCLUDE_REGEXP" <<< "$f" && \
+ continue
+
dn=$(dirname $f | sed -n -e "s#^$RPM_BUILD_ROOT##p")
bn=$(basename $f .debug).debug
@@ -31,15 +34,12 @@ do
echo extracting debug info from $f
/usr/lib/rpm/debugedit -b "$RPM_BUILD_DIR" -d /usr/src/debug -l "$SOURCEFILE" "$f"
if test -w "$f"; then
- eu-strip -f "${debugfn}" "$f" -o $f.stripped || :
+ eu-strip -f "${debugfn}" "$f" || :
else
chmod u+w "$f"
- eu-strip -f "${debugfn}" "$f" -o $f.stripped || :
+ eu-strip -f "${debugfn}" "$f" || :
chmod u-w "$f"
fi
- { [[ -z "$EXCLUDE_REGEXP" ]] || \
- { echo $f | egrep -qv "$EXCLUDE_REGEXP"; } } && mv -f $f.stripped $f
- rm -f $f.stripped
done
mkdir -p ${RPM_BUILD_ROOT}/usr/src/debug