diff options
author | Gwenolé Beauchesne <gbeauchesne@mandriva.org> | 2006-01-04 13:43:08 +0000 |
---|---|---|
committer | Gwenolé Beauchesne <gbeauchesne@mandriva.org> | 2006-01-04 13:43:08 +0000 |
commit | 154889050ed8a4b6d9685cb47a4f9e25779173f8 (patch) | |
tree | 5c78a7c6d8ff6641e7c44bbd28e84916d177460d /find-debuginfo.sh | |
parent | a840159143376380c01491ecfadce9b157c8afac (diff) | |
download | rpm-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-x | find-debuginfo.sh | 12 |
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 |