From 117818462b21e0ba4933a1bcf9cac65249ce74c209fde1d51def628b67705cd6 Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Thu, 16 Feb 2012 21:00:43 +0000 Subject: [PATCH 1/6] Updating link to change in openSUSE:Factory/build-compare revision 66.0 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=27c1f4fdfdca4a93acea6de1567972c3 --- build-compare.changes | 5 +++++ same-build-result.sh | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build-compare.changes b/build-compare.changes index a498d54..79daad7 100644 --- a/build-compare.changes +++ b/build-compare.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Feb 16 21:00:31 UTC 2012 - coolo@suse.com + +- fix missing test in shell script + ------------------------------------------------------------------- Thu Feb 16 13:39:21 UTC 2012 - coolo@suse.com diff --git a/same-build-result.sh b/same-build-result.sh index a1e718b..db630b1 100644 --- a/same-build-result.sh +++ b/same-build-result.sh @@ -106,7 +106,7 @@ if test -e $OLDDIR/rpmlint.log -a -e $OTHERDIR/rpmlint.log; then SUCCESS=0 fi rm $file1 $file2 -elif -e $OTHERDIR/rpmlint.log; then +elif test -e $OTHERDIR/rpmlint.log; then echo "rpmlint.log is new" SUCCESS=0 fi @@ -120,7 +120,7 @@ if test -e $OLDDIR/appdata.xml -a -e $OTHERDIR/appdata.xml; then diff -u0 $file1 $file2 |head -n 20 SUCCESS=0 fi -elif -e $OTHERDIR/appdata.xml; then +elif test -e $OTHERDIR/appdata.xml; then echo "appdata.xml is new" SUCCESS=0 fi From d25523af58f4c59073cb2f2280236cf601feb33d99efaa8be3bfc7cbc6947347 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Thu, 16 Feb 2012 21:01:26 +0000 Subject: [PATCH 2/6] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=121 --- build-compare.changes | 1 - 1 file changed, 1 deletion(-) diff --git a/build-compare.changes b/build-compare.changes index 79daad7..5726b56 100644 --- a/build-compare.changes +++ b/build-compare.changes @@ -2,7 +2,6 @@ Thu Feb 16 21:00:31 UTC 2012 - coolo@suse.com - fix missing test in shell script - ------------------------------------------------------------------- Thu Feb 16 13:39:21 UTC 2012 - coolo@suse.com From f139ea5c414bd38816e8e2e04fb70f69c9020195de7e9dee73206cf9f87380eb Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Thu, 16 Feb 2012 21:01:34 +0000 Subject: [PATCH 3/6] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=122 --- build-compare.changes | 1 + 1 file changed, 1 insertion(+) diff --git a/build-compare.changes b/build-compare.changes index 5726b56..79daad7 100644 --- a/build-compare.changes +++ b/build-compare.changes @@ -2,6 +2,7 @@ Thu Feb 16 21:00:31 UTC 2012 - coolo@suse.com - fix missing test in shell script + ------------------------------------------------------------------- Thu Feb 16 13:39:21 UTC 2012 - coolo@suse.com From d521ef89cd51486b76f1b63123892299c7a06347454b229f0167daf84c47314d Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Wed, 22 Feb 2012 07:49:21 +0000 Subject: [PATCH 4/6] Accepting request 106406 from home:a_jaeger:branches:build-compare-test Quote dot in release to not have false matches OBS-URL: https://build.opensuse.org/request/show/106406 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=123 --- build-compare.changes | 5 +++++ build-compare.spec | 1 + functions.sh | 5 +++-- same-build-result.sh | 5 +++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/build-compare.changes b/build-compare.changes index 79daad7..8078b4c 100644 --- a/build-compare.changes +++ b/build-compare.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Feb 18 18:27:40 UTC 2012 - aj@suse.de + +- Quote dot in release to not have false matches. + ------------------------------------------------------------------- Thu Feb 16 21:00:31 UTC 2012 - coolo@suse.com diff --git a/build-compare.spec b/build-compare.spec index c10f693..e388fcf 100644 --- a/build-compare.spec +++ b/build-compare.spec @@ -16,6 +16,7 @@ # + Name: build-compare Summary: Build Result Compare Script License: GPL-2.0+ diff --git a/functions.sh b/functions.sh index 8f75b00..17ba192 100644 --- a/functions.sh +++ b/functions.sh @@ -87,8 +87,9 @@ function cmp_spec () return 1 fi - release1=`$RPM --qf "%{RELEASE}" "$oldrpm"` - release2=`$RPM --qf "%{RELEASE}" "$newrpm"` + # Remember to quote the . which is in release + release1=`$RPM --qf "%{RELEASE}" "$oldrpm"|sed -e 's/\./\\./g'` + release2=`$RPM --qf "%{RELEASE}" "$newrpm"|sed -e 's/\./\\./g'` # This might happen with a forced rebuild of factory if [ "${release1%.*}" != "${release2%.*}" ] ; then echo "release prefix mismatch" diff --git a/same-build-result.sh b/same-build-result.sh index db630b1..cfc6c1a 100644 --- a/same-build-result.sh +++ b/same-build-result.sh @@ -63,8 +63,9 @@ OLDRPMS=($(find "$OLDDIR" -name \*rpm -a ! -name \*src.rpm -a ! -name \*.delta. 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[0]}"` -release2=`rpm -qp --nodigest --nosignature --qf "%{RELEASE}" "${NEWRPMS[0]}"` +# Remember to quote the "." for future regexes +release1=`rpm -qp --nodigest --nosignature --qf "%{RELEASE}" "${OLDRPMS[0]}"|sed -e 's/\./\\./g'` +release2=`rpm -qp --nodigest --nosignature --qf "%{RELEASE}" "${NEWRPMS[0]}"|sed -e 's/\./\\./g'` SUCCESS=1 rpmqp='rpm -qp --qf %{NAME} --nodigest --nosignature ' From 2d10a86db3fc6b8735e89937ae3614f6347f6670e1377d3d3f6ac3867be9b538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Wed, 22 Feb 2012 11:12:05 +0000 Subject: [PATCH 5/6] Accepting request 106433 from home:coolo:appstream - I changed my mind, appdata.xml is too hard to get right. So we need to support variable binary names for the appdata OBS-URL: https://build.opensuse.org/request/show/106433 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=124 --- build-compare.changes | 6 ++++++ build-compare.spec | 1 - same-build-result.sh | 25 ++++++++++++++----------- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/build-compare.changes b/build-compare.changes index 8078b4c..4300c1f 100644 --- a/build-compare.changes +++ b/build-compare.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Feb 22 11:07:53 UTC 2012 - coolo@suse.com + +- I changed my mind, appdata.xml is too hard to get right. So + we need to support variable binary names for the appdata + ------------------------------------------------------------------- Sat Feb 18 18:27:40 UTC 2012 - aj@suse.de diff --git a/build-compare.spec b/build-compare.spec index e388fcf..c10f693 100644 --- a/build-compare.spec +++ b/build-compare.spec @@ -16,7 +16,6 @@ # - Name: build-compare Summary: Build Result Compare Script License: GPL-2.0+ diff --git a/same-build-result.sh b/same-build-result.sh index cfc6c1a..2fcaf89 100644 --- a/same-build-result.sh +++ b/same-build-result.sh @@ -112,19 +112,22 @@ elif test -e $OTHERDIR/rpmlint.log; then SUCCESS=0 fi -# compare appstream data -if test -e $OLDDIR/appdata.xml -a -e $OTHERDIR/appdata.xml; then - file1=$OLDDIR/appdata.xml - file2=$OTHERDIR/appdata.xml - if ! cmp -s $file1 $file2; then - echo "appdata.xml files differ:" - diff -u0 $file1 $file2 |head -n 20 +appdatas=`cd $OTHERDIR && find . -name *-appdata.xml` +for xml in $appdatas; do + # compare appstream data + if test -e $OLDDIR/$xml -a -e $OTHERDIR/$xml; then + file1=$OLDDIR/$xml + file2=$OTHERDIR/$xml + if ! cmp -s $file1 $file2; then + echo "$xml files differ:" + diff -u0 $file1 $file2 |head -n 20 + SUCCESS=0 + fi + elif test -e $OTHERDIR/$xml; then + echo "$xml is new" SUCCESS=0 fi -elif test -e $OTHERDIR/appdata.xml; then - echo "appdata.xml is new" - SUCCESS=0 -fi +done if test $SUCCESS -eq 0; then exit 1 From ab4f8379cd8206d0d0505480a8aefaae45c38fd2cc25e516efc71be50c5f3979 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Wed, 22 Feb 2012 11:24:20 +0000 Subject: [PATCH 6/6] Accepting request 106436 from home:a_jaeger:branches:build-compare-test Remove release from pre/post scripts OBS-URL: https://build.opensuse.org/request/show/106436 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=125 --- build-compare.changes | 5 +++++ build-compare.spec | 1 + functions.sh | 15 ++++++++++++--- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/build-compare.changes b/build-compare.changes index 4300c1f..3a2f99c 100644 --- a/build-compare.changes +++ b/build-compare.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Feb 22 11:12:13 UTC 2012 - aj@suse.de + +- Remove release from pre/post scripts. + ------------------------------------------------------------------- Wed Feb 22 11:07:53 UTC 2012 - coolo@suse.com diff --git a/build-compare.spec b/build-compare.spec index c10f693..e388fcf 100644 --- a/build-compare.spec +++ b/build-compare.spec @@ -16,6 +16,7 @@ # + Name: build-compare Summary: Build Result Compare Script License: GPL-2.0+ diff --git a/functions.sh b/functions.sh index 17ba192..48ac53d 100644 --- a/functions.sh +++ b/functions.sh @@ -1,6 +1,6 @@ #! /bin/bash # -# Copyright (c) 2009, 2010, 2011 SUSE Linux Product GmbH, Germany. +# Copyright (c) 2009, 2010, 2011, 2012 SUSE Linux Product GmbH, Germany. # Licensed under GPL v2, see COPYING file for details. # # Written by Michael Matz and Stephan Coolo @@ -62,8 +62,7 @@ function cmp_spec () QF="$QF %{EXCLUSIVEOS} %{RPMVERSION} %{PLATFORM}\\n" QF="$QF %{PAYLOADFORMAT} %{PAYLOADCOMPRESSOR} %{PAYLOADFLAGS}\\n" - QF="$QF [%{PREINPROG} %{PREIN}\\n]\\n[%{POSTINPROG} %{POSTIN}\\n]\\n[%{PREUNPROG} %{PREUN}\\n]\\n[%{POSTUNPROG} %{POSTUN}\\n]\\n" - + # XXX We also need to check the existence (but not the content (!)) # of SIGGPG (and perhaps the other SIG*) @@ -99,6 +98,16 @@ function cmp_spec () check_provides $oldrpm $release1 > $file1 check_provides $newrpm $release2 > $file2 + if ! diff -au $file1 $file2; then + rm $file1 $file2 + return 1 + fi + + # scripts, might contain release number + QF="[%{PREINPROG} %{PREIN}\\n]\\n[%{POSTINPROG} %{POSTIN}\\n]\\n[%{PREUNPROG} %{PREUN}\\n]\\n[%{POSTUNPROG} %{POSTUN}\\n]\\n" + check_header $oldrpm | sed -e "s,-$release1$,-@RELEASE@," > $file1 + check_header $newrpm | sed -e "s,-$release2$,-@RELEASE@," > $file2 + if ! diff -au $file1 $file2; then rm $file1 $file2 return 1