OBS User unknown 2008-09-15 23:28:45 +00:00 committed by Git OBS Bridge
parent 8c64a58df3
commit 121fc455c2
5 changed files with 70 additions and 23 deletions

View File

@ -5,12 +5,12 @@ build the binary. The patches moves them into a separate package -debugsource.
---
macros.in | 12 ++++++++++++
scripts/find-debuginfo.sh | 43 ++++++++++++++++++++++++++-----------------
2 files changed, 38 insertions(+), 17 deletions(-)
scripts/find-debuginfo.sh | 12 +++++++++---
2 files changed, 21 insertions(+), 3 deletions(-)
Index: macros.in
Index: b/macros.in
===================================================================
--- macros.in.orig
--- macros.in
+++ macros.in
@@ -183,6 +183,18 @@ Debug information is useful when develop
package or when debugging this package.\
@ -31,19 +31,19 @@ Index: macros.in
%{nil}
%_defaultdocdir %{_usr}/doc/packages
Index: scripts/find-debuginfo.sh
Index: b/scripts/find-debuginfo.sh
===================================================================
--- scripts/find-debuginfo.sh.orig
--- scripts/find-debuginfo.sh
+++ scripts/find-debuginfo.sh
@@ -172,8 +172,8 @@ set -o pipefail
strict_error=ERROR
$strict || strict_error=WARNING
-# Strip ELF binaries
-find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm +111 -or -name "*.so*" -or -name "*.ko" \) |
-find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm +111 -or -name "*.so*" -or -name "*.ko" \) -print 0 |
+# Strip ELF binaries (and no static libraries)
+find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm +111 -or -name "*.so*" -or -name "*.ko" \) ! -name "*.a" |
xargs --no-run-if-empty stat -c '%h %D_%i %n' |
+find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm +111 -or -name "*.so*" -or -name "*.ko" \) ! -name "*.a" -print0 |
xargs --no-run-if-empty -0 stat -c '%h %D_%i %n' |
while read nlinks inum f; do
case $(objdump -h $f 2>/dev/null | egrep -o '(debug[\.a-z_]*|gnu.version)') in
@@ -282,10 +282,16 @@ if [ -d "${RPM_BUILD_ROOT}/usr/lib" -o -

View File

@ -1,8 +1,36 @@
Index: scripts/find-debuginfo.sh
===================================================================
--- scripts/find-debuginfo.sh.orig
+++ scripts/find-debuginfo.sh
@@ -173,12 +173,18 @@ strict_error=ERROR
--- scripts/find-debuginfo.sh 2008/09/15 22:56:11 1.1
+++ scripts/find-debuginfo.sh 2008/09/15 22:58:57
@@ -126,6 +126,20 @@
link_relative "$t" "$l" "$RPM_BUILD_ROOT"
}
+# Compare two binaries but ignore the .note.gnu.build-id section
+elfcmp()
+{
+ local tmp1=$(mktemp -t ${1##*/}.XXXXXX)
+ local tmp2=$(mktemp -t ${2##*/}.XXXXXX)
+
+ objcopy -O binary -R .note.gnu.build-id $1 $tmp1
+ objcopy -O binary -R .note.gnu.build-id $2 $tmp2
+ cmp -s $tmp1 $tmp2
+ local res=$?
+ rm -f $tmp1 $tmp2
+ return $res
+}
+
# Make a build-id symlink for id $1 with suffix $3 to file $2.
make_id_link()
{
@@ -144,7 +158,7 @@
local other=$(readlink -m "$root_idfile")
other=${other#$RPM_BUILD_ROOT}
if cmp -s "$root_idfile" "$RPM_BUILD_ROOT$file" ||
- eu-elfcmp -q "$root_idfile" "$RPM_BUILD_ROOT$file" 2> /dev/null; then
+ elfcmp "$root_idfile" "$RPM_BUILD_ROOT$file" ; then
# Two copies. Maybe one has to be setuid or something.
echo >&2 "*** WARNING: identical binaries are copied, not linked:"
echo >&2 " $file"
@@ -173,12 +187,18 @@
$strict || strict_error=WARNING
# Strip ELF binaries
@ -10,8 +38,9 @@ Index: scripts/find-debuginfo.sh
- \( -perm -0100 -or -perm -0010 -or -perm -0001 \) \
- -print |
-file -N -f - | sed -n -e 's/^\(.*\):[ ]*.*ELF.*, not stripped/\1/p' |
+find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm +111 -or -name "*.so*" -or -name "*.ko" \) |
xargs --no-run-if-empty stat -c '%h %D_%i %n' |
-xargs --no-run-if-empty stat -c '%h %D_%i %n' |
+find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm +111 -or -name "*.so*" -or -name "*.ko" \) -print 0 |
+xargs --no-run-if-empty -0 stat -c '%h %D_%i %n' |
while read nlinks inum f; do
+ case $(objdump -h $f 2>/dev/null | egrep -o '(debug[\.a-z_]*|gnu.version)') in
+ *debuglink*) continue ;;
@ -25,7 +54,7 @@ Index: scripts/find-debuginfo.sh
get_debugfn "$f"
[ -f "${debugfn}" ] && continue
@@ -199,6 +205,8 @@ while read nlinks inum f; do
@@ -199,6 +219,8 @@
fi
echo "extracting debug info from $f"
@ -34,7 +63,7 @@ Index: scripts/find-debuginfo.sh
id=$(/usr/lib/rpm/debugedit -b "$RPM_BUILD_DIR" -d /usr/src/debug \
-i -l "$SOURCEFILE" "$f") || exit
if [ -z "$id" ]; then
@@ -215,13 +223,25 @@ while read nlinks inum f; do
@@ -215,13 +237,25 @@
esac
mkdir -p "${debugdn}"
@ -67,7 +96,7 @@ Index: scripts/find-debuginfo.sh
if [ -n "$id" ]; then
make_id_link "$id" "$dn/$(basename $f)"
@@ -250,12 +270,14 @@ if [ -s "$SOURCEFILE" ]; then
@@ -250,12 +284,14 @@
# stupid cpio creates new directories in mode 0700, fixup
find "${RPM_BUILD_ROOT}/usr/src/debug" -type d -print0 |
xargs --no-run-if-empty -0 chmod a+rx

View File

@ -24,7 +24,7 @@ License: GPL v2 or later
Group: System/Packages
Summary: Python Bindings for Manipulating RPM Packages
Version: 4.4.2.3
Release: 2
Release: 5
Requires: rpm = %{version}
%py_requires
Source99: rpm.spec

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Tue Sep 16 01:01:30 CEST 2008 - ro@suse.de
- fix find-debuginfo.sh and debugsource-package.diff to even
apply (directory depth)
- add hack from jblunck using home made elfcmp
-------------------------------------------------------------------
Mon Sep 15 20:32:32 CEST 2008 - jblunck@suse.de
- fix find-debuginfo.sh to work on filenames with spaces in
-------------------------------------------------------------------
Fri Sep 12 18:16:33 CEST 2008 - mls@suse.de

View File

@ -27,7 +27,7 @@ PreReq: %insserv_prereq %fillup_prereq permissions
AutoReqProv: on
Summary: The RPM Package Manager
Version: 4.4.2.3
Release: 2
Release: 5
Source: rpm-%{version}.tar.bz2
Source1: RPM-HOWTO.tar.bz2
Source2: RPM-Tips.html.tar.bz2
@ -306,7 +306,7 @@ Summary: A C library for parsing command line parameters
License: LGPL v2.1 or later
Group: System/Libraries
Version: 1.7
Release: 450
Release: 453
#
%description -n popt
@ -329,7 +329,7 @@ Summary: C Library for Parsing Command Line Parameters
License: LGPL v2.1 or later
Group: System/Libraries
Version: 1.7
Release: 450
Release: 453
Requires: popt = 1.7
Requires: glibc-devel
@ -364,6 +364,12 @@ Authors:
%doc %{_mandir}/man3/popt.3*
%changelog
* Tue Sep 16 2008 ro@suse.de
- fix find-debuginfo.sh and debugsource-package.diff to even
apply (directory depth)
- add hack from jblunck using home made elfcmp
* Mon Sep 15 2008 jblunck@suse.de
- fix find-debuginfo.sh to work on filenames with spaces in
* Fri Sep 12 2008 mls@suse.de
- fix changelog cutter
- fix find-requires script