From b9bbf88e67252f30bd5aca0212698153ca01d74787178c8fbb434a5e34d848c2 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Thu, 3 Jul 2014 10:49:49 +0000 Subject: [PATCH] Accepting request 239419 from home:a_jaeger:FactoryFix Handle debug infos better OBS-URL: https://build.opensuse.org/request/show/239419 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=140 --- build-compare.changes | 7 +++++++ build-compare.spec | 2 +- rpm-check.sh | 12 ++++++++---- same-build-result.sh | 10 +++++++--- 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/build-compare.changes b/build-compare.changes index fb51606..028ec44 100644 --- a/build-compare.changes +++ b/build-compare.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri May 9 18:30:26 UTC 2014 - johannesobermayr@gmx.de + +- Don't compare .note.gnu.build-id and .gnu_debuglink sections in ELF + binaries (bnc#877078). +- Don't compare debuginfo packages. + ------------------------------------------------------------------- Thu Oct 17 12:44:19 UTC 2013 - schwab@suse.de diff --git a/build-compare.spec b/build-compare.spec index 80e6db6..086e88a 100644 --- a/build-compare.spec +++ b/build-compare.spec @@ -1,7 +1,7 @@ # # spec file for package build-compare # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed diff --git a/rpm-check.sh b/rpm-check.sh index 13605ef..1014ab2 100644 --- a/rpm-check.sh +++ b/rpm-check.sh @@ -460,10 +460,14 @@ check_single_file() head -n 200 $dfile return 1 fi - objdump -s old/$file > $file1 - sed -i -e "s,old/,," $file1 - objdump -s new/$file > $file2 - sed -i -e "s,new/,," $file2 + echo "" >$file1 + echo "" >$file2 + # Don't compare .build-id and .gnu_debuglink sections + for section in $(objdump -s $file | grep "Contents of section .*:" | sed -r "s,.* (\..*):,\1,g" | grep -v -e "\.build-id" -e "\.gnu_debuglink" | tr +"\n" " "); do + objdump -s -j $section old/$file | sed "s,old/,," >> $file1 + objdump -s -j $section new/$file | sed "s,new/,," >> $file2 + done if ! diff -u $file1 $file2 > $dfile; then echo "$file differs in ELF sections" head -n 200 $dfile diff --git a/same-build-result.sh b/same-build-result.sh index fe185e9..ddf95b0 100644 --- a/same-build-result.sh +++ b/same-build-result.sh @@ -79,9 +79,13 @@ for opac in ${OLDRPMS[*]}; do echo "names differ: $oname $nname" exit 1 fi - bash $CMPSCRIPT "$opac" "$npac" || SUCCESS=0 - if test $SUCCESS -eq 0 -a -z "$check_all"; then - exit 1 + if [ $(echo "$opac" | grep -e "debuginfo") ]; then + echo "skipping -debuginfo package" + else + bash $CMPSCRIPT "$opac" "$npac" || SUCCESS=0 + if test $SUCCESS -eq 0 -a -z "$check_all"; then + exit 1 + fi fi done