SOURCES (rpm-4_4_9): rpm-debuginfo.patch - cleanups, exit early if...
glen
glen at pld-linux.org
Thu Jan 31 01:20:22 CET 2008
Author: glen Date: Thu Jan 31 00:20:22 2008 GMT
Module: SOURCES Tag: rpm-4_4_9
---- Log message:
- cleanups, exit early if nothing to be found
---- Files affected:
SOURCES:
rpm-debuginfo.patch (1.15.6.1 -> 1.15.6.2)
---- Diffs:
================================================================
Index: SOURCES/rpm-debuginfo.patch
diff -u SOURCES/rpm-debuginfo.patch:1.15.6.1 SOURCES/rpm-debuginfo.patch:1.15.6.2
--- SOURCES/rpm-debuginfo.patch:1.15.6.1 Wed Jan 30 21:57:08 2008
+++ SOURCES/rpm-debuginfo.patch Thu Jan 31 01:20:17 2008
@@ -44,9 +44,31 @@
%{__arch_install_post}\
%{__os_install_post}\
%{nil}
---- rpm-4.4.6.org/scripts/find-debuginfo.sh 2006-02-12 15:59:51.000000000 +0100
-+++ rpm-4.4.6/scripts/find-debuginfo.sh 2006-06-30 22:03:53.451126000 +0200
-@@ -15,7 +15,8 @@
+--- rpm-4.4.9/scripts/find-debuginfo.sh~ 2008-01-31 02:10:36.032662759 +0200
++++ rpm-4.4.9/scripts/find-debuginfo.sh 2008-01-31 02:11:05.000000000 +0200
+@@ -1,36 +1,49 @@
+ #!/bin/sh
+-#find-debuginfo.sh - automagically generate debug info and file list
+-#for inclusion in an rpm spec file.
++# find-debuginfo.sh - automagically generate debug info and file list
++# for inclusion in an rpm spec file.
+
+-if [ -z "$1" ] ; then BUILDDIR="."
+-else BUILDDIR=$1
++if [ -z "$1" ]; then
++ BUILDDIR="."
++else
++ BUILDDIR=$1
+ fi
+
+ LISTFILE=$BUILDDIR/debugfiles.list
+ SOURCEFILE=$BUILDDIR/debugsources.list
+
+-debugdir="${RPM_BUILD_ROOT}/usr/lib/debug"
+-
+-echo -n > $SOURCEFILE
++: > $SOURCEFILE
++: > $LISTFILE
strip_to_debug()
{
@@ -55,9 +77,36 @@
+ objcopy --add-gnu-debuglink="$1" "$2"
}
++filelist=$(find $RPM_BUILD_ROOT ! -path "$RPM_BUILD_ROOT/usr/lib/debug/*.debug" -type f '(' -perm -0100 -or -perm -0010 -or -perm -0001 ')')
++if [ -z "$filelist" ]; then
++ # no files, exit
++ exit 0
++fi
++
++filetypes=$(echo "$filelist" | xargs -r -d'\n' file)
++elflist=$(echo "$filetypes" | awk -F: '/ELF.*, not stripped/ {print $1}')
++if [ -z "$elflist" ]; then
++ # no elf objects, exit
++ exit 0
++fi
++
# Strip ELF binaries
-@@ -30,7 +31,7 @@
- [ -f "${debugfn}" ] && continue
+-for f in `find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
+- sed -n -e 's/^\(.*\):[ ]*.*ELF.*, not stripped/\1/p'`
+-do
+- 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
++echo "$elflist" | while read f; do
++ dn=$(dirname "${f#$RPM_BUILD_ROOT}")
++ bn=$(basename "$f" .debug).debug
++
++ debugdn="$RPM_BUILD_ROOT/usr/lib/debug$dn"
++ debugfn="$debugdn/$bn"
++ [ -f "$debugfn" ] && continue
echo extracting debug info from $f
- /usr/lib/rpm/debugedit -b "$RPM_BUILD_DIR" -d /usr/src/debug -l "$SOURCEFILE" "$f"
@@ -65,9 +114,33 @@
# A binary already copied into /usr/lib/debug doesn't get stripped,
# just has its file names collected and adjusted.
-@@ -54,4 +55,5 @@
- find ${RPM_BUILD_ROOT}/usr/src/debug -type d -print0 | xargs -0 chmod a+rx
+@@ -38,20 +51,22 @@
+ /usr/lib/debug/*) continue ;;
+ esac
+
+- mkdir -p "${debugdn}"
++ mkdir -p "$debugdn"
+ if test -w "$f"; then
+- strip_to_debug "${debugfn}" "$f"
++ strip_to_debug "$debugfn" "$f"
+ else
+ chmod u+w "$f"
+- strip_to_debug "${debugfn}" "$f"
++ strip_to_debug "$debugfn" "$f"
+ chmod u-w "$f"
+ fi
+ done
+
+-mkdir -p ${RPM_BUILD_ROOT}/usr/src/debug
++mkdir -p $RPM_BUILD_ROOT/usr/src/debug
+ cat $SOURCEFILE | (cd $RPM_BUILD_DIR; LANG=C sort -z -u | cpio -pd0mL ${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/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/lib/debug -mindepth 1 -type d | sed -n -e "s#^$RPM_BUILD_ROOT#%dir #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/lib/debug -mindepth 1 -type d | sed -n -e "s#^$RPM_BUILD_ROOT#%dir #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
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/rpm-debuginfo.patch?r1=1.15.6.1&r2=1.15.6.2&f=u
More information about the pld-cvs-commit
mailing list