diff options
author | jbj <devnull@localhost> | 2003-12-28 15:36:06 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2003-12-28 15:36:06 +0000 |
commit | b7a722971a8e78efe49aee6dc98185e8b1ae042b (patch) | |
tree | 29b13d60dcd47a781c832059b7b68f2d7d5fcb11 | |
parent | 98b52012449200e9d0f6a1a1dd36824c95a13c61 (diff) | |
download | librpm-tizen-b7a722971a8e78efe49aee6dc98185e8b1ae042b.tar.gz librpm-tizen-b7a722971a8e78efe49aee6dc98185e8b1ae042b.tar.bz2 librpm-tizen-b7a722971a8e78efe49aee6dc98185e8b1ae042b.zip |
- find-debuginfo.sh: permit stripping unwritable by non-root (#112429).
CVS patchset: 7040
CVS date: 2003/12/28 15:36:06
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | scripts/find-debuginfo.sh | 30 |
2 files changed, 22 insertions, 9 deletions
@@ -31,6 +31,7 @@ - flush pipe before exit 1 in check-files (#103867). - perl.req: avoid regex misfire on '^use' in "= <<" assign (#109934). - use perldeps {--provides|--requires}. + - find-debuginfo.sh: permit stripping unwritable by non-root (#112429). 4.2 -> 4.2.1: - fix: nested %if handling, optind initialization posix vs. glibc. diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh index aa37f8305..15f4c2c60 100644 --- a/scripts/find-debuginfo.sh +++ b/scripts/find-debuginfo.sh @@ -9,19 +9,31 @@ fi LISTFILE=$BUILDDIR/debugfiles.list SOURCEFILE=$BUILDDIR/debugsources.list +debugdir="${RPM_BUILD_ROOT}/usr/lib/debug" + echo -n > $SOURCEFILE # Strip ELF binaries -for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \ +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.*, not stripped/\1/p'` do - BASEDIR=`dirname $f | sed -n -e "s#^$RPM_BUILD_ROOT#/#p"` - [ "$BASEDIR" = "/usr/lib/debug" ] && continue; - OUTPUTDIR=${RPM_BUILD_ROOT}/usr/lib/debug${BASEDIR} - mkdir -p ${OUTPUTDIR} + dn=$(dirname $f | sed -n -e "s#^$RPM_BUILD_ROOT##p") + bn=$(basename $f .debug).debug + + debugdn="${debugdir}${dn}" + debugfn="${debugdn}/${bn}" + [ -f "${debugfn}" ] && continue + + mkdir -p "${debugdn}" echo extracting debug info from $f - /usr/lib/rpm/debugedit -b $RPM_BUILD_DIR -d /usr/src/debug -l $SOURCEFILE $f - eu-strip -f $OUTPUTDIR/`basename $f`.debug $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" || : + else + chmod u+w "$f" + eu-strip -f "${debugfn}" "$f" || : + chmod u-w "$f" + fi done mkdir -p ${RPM_BUILD_ROOT}/usr/src/debug @@ -29,5 +41,5 @@ cat $SOURCEFILE | (cd $RPM_BUILD_DIR; LANG=C sort -z -u | cpio -pd0m ${RPM_BUILD # stupid cpio creates new directories in mode 0700, fixup find ${RPM_BUILD_ROOT}/usr/src/debug -type d -print0 | xargs -0 chmod a+rx -find ${RPM_BUILD_ROOT}/usr/lib/debug -type f | sed -n -e "s#^$RPM_BUILD_ROOT#/#p" > $LISTFILE -find ${RPM_BUILD_ROOT}/usr/src/debug -mindepth 1 -maxdepth 1 | sed -n -e "s#^$RPM_BUILD_ROOT#/#p" >> $LISTFILE +find ${RPM_BUILD_ROOT}/usr/lib/debug -type f | sed -n -e "s#^$RPM_BUILD_ROOT##p" > $LISTFILE +find ${RPM_BUILD_ROOT}/usr/src/debug -mindepth 1 -maxdepth 1 | sed -n -e "s#^$RPM_BUILD_ROOT##p" >> $LISTFILE |