From de1e1ea41399abbb66b6754b832dcf403c957d2aa85e76c74f88fece2246f6d6 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Thu, 26 Jan 2012 18:52:20 +0000 Subject: [PATCH] Accepting request 101698 from home:a_jaeger:branches:build-compare-test Remove release from rpmlint.log before comparing. OBS-URL: https://build.opensuse.org/request/show/101698 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=113 --- build-compare.changes | 5 +++++ build-compare.spec | 2 +- same-build-result.sh | 18 ++++++++++++------ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/build-compare.changes b/build-compare.changes index 61690fb..366fab3 100644 --- a/build-compare.changes +++ b/build-compare.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jan 26 10:01:55 UTC 2012 - aj@suse.de + +- Remove release from rpmlint.log before comparing. + ------------------------------------------------------------------- Fri Jan 20 08:49:39 UTC 2012 - aj@suse.de diff --git a/build-compare.spec b/build-compare.spec index 605eb61..377db3b 100644 --- a/build-compare.spec +++ b/build-compare.spec @@ -21,7 +21,7 @@ Name: build-compare License: GPL-2.0+ Group: Development/Tools/Building Summary: Build Result Compare Script -Version: 2012.01.09 +Version: 2012.01.26 Release: 6 Source1: COPYING Source2: same-build-result.sh diff --git a/same-build-result.sh b/same-build-result.sh index 47f3fe7..317a962 100644 --- a/same-build-result.sh +++ b/same-build-result.sh @@ -62,6 +62,10 @@ bash $SCMPSCRIPT "$osrpm" "$nsrpm" || exit 1 OLDRPMS=($(find "$OLDDIR" -name \*rpm -a ! -name \*src.rpm -a ! -name \*.delta.rpm|sort|grep -v -- -32bit-|grep -v -- -64bit-|grep -v -- '-x86-.*\.ia64\.rpm')) NEWRPMS=($(find $NEWDIRS -name \*rpm -a ! -name \*src.rpm -a ! -name \*.delta.rpm|sort --field-separator=/ --key=7|grep -v -- -32bit-|grep -v -- -64bit-|grep -v -- '-x86-.*\.ia64\.rpm')) +# Get release from first RPM and keep for rpmlint check +release1=`rpm -qp --nodigest --nosignature --qf "%{RELEASE}" "${OLDRPMS[1]}"` +release2=`rpm -qp --nodigest --nosignature --qf "%{RELEASE}" "${NEWRPMS[1]}"` + SUCCESS=1 rpmqp='rpm -qp --qf %{NAME} --nodigest --nosignature ' for opac in ${OLDRPMS[*]}; do @@ -89,17 +93,19 @@ fi RPMLINTDIR=/home/abuild/rpmbuild/OTHER if test -e $OLDDIR/rpmlint.log -a -e $RPMLINTDIR/rpmlint.log; then + file1=`mktemp` + file2=`mktemp` echo "comparing $OLDDIR/rpmlint.log and $RPMLINTDIR/rpmlint.log" # Sort the files first since the order of messages is not deterministic - sort -u $OLDDIR/rpmlint.log > $OLDDIR/rpmlint.log.sorted - sort -u $RPMLINTDIR/rpmlint.log > $RPMLINTDIR/rpmlint.log.sorted - if ! cmp -s $OLDDIR/rpmlint.log.sorted $RPMLINTDIR/rpmlint.log.sorted; then + # Remove release from files + sort -u $OLDDIR/rpmlint.log|sed -e "s,$release1, @RELEASE@," > $file1 + sort -u $RPMLINTDIR/rpmlint.log|sed -e "s,$release2, @RELEASE@," > $file2 + if ! cmp -s $file1 $file2; then echo "rpmlint.log files differ:" diff -u $OLDDIR/rpmlint.log $RPMLINTDIR/rpmlint.log|head -n 20 - rm $OLDDIR/rpmlint.log.sorted $RPMLINTDIR/rpmlint.log.sorted - exit 1 + SUCCESS=0 fi - rm $OLDDIR/rpmlint.log.sorted $RPMLINTDIR/rpmlint.log.sorted + rm $file1 $file2 fi if test $SUCCESS -eq 0; then