diff options
author | jbj <devnull@localhost> | 2002-10-18 16:01:59 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2002-10-18 16:01:59 +0000 |
commit | 71f563826d0155b77165230cf90a2739d7d2f679 (patch) | |
tree | 957b7a6f738e38da18a3e1ef4033958056b632a7 /scripts/find-debuginfo.sh | |
parent | 81ff484d0ff37cc097d09540ea24e6577df92e41 (diff) | |
download | rpm-71f563826d0155b77165230cf90a2739d7d2f679.tar.gz rpm-71f563826d0155b77165230cf90a2739d7d2f679.tar.bz2 rpm-71f563826d0155b77165230cf90a2739d7d2f679.zip |
Debug package patch.
CVS patchset: 5788
CVS date: 2002/10/18 16:01:59
Diffstat (limited to 'scripts/find-debuginfo.sh')
-rw-r--r-- | scripts/find-debuginfo.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh index 39ae760f9..960067533 100644 --- a/scripts/find-debuginfo.sh +++ b/scripts/find-debuginfo.sh @@ -3,6 +3,10 @@ #for inclusion in an rpm spec file. LISTFILE=debugfiles.list +SOURCEFILE=debugsources.list + +touch .debug_saved_mode +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 {} \; | \ @@ -11,7 +15,19 @@ for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm OUTPUTDIR=${RPM_BUILD_ROOT}/usr/lib/debug${BASEDIR} mkdir -p ${OUTPUTDIR} echo extracting debug info from $f + #save old mode + chmod --reference=$f .debug_saved_mode + #make sure we have write perms + chmod u+w $f + /usr/lib/rpm/debugedit -b $RPM_BUILD_DIR -d /usr/src/debug -l $SOURCEFILE $f + chmod --reference=.debug_saved_mode $f /usr/lib/rpm/striptofile -g -u -o $OUTPUTDIR $f || : done +mkdir -p ${RPM_BUILD_ROOT}/usr/src/debug +(DIR=`pwd`; cd $RPM_BUILD_DIR; LANG=C sort $DIR/$SOURCEFILE -z -u | cpio -pd0m ${RPM_BUILD_ROOT}/usr/src/debug) +# 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 |