From 4eee464bef27b2b00f0de509e451bcd9a011bb33c5fd336a5f6432da030d7b0e Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Thu, 16 Feb 2012 14:18:23 +0000 Subject: [PATCH 1/2] Accepting request 105424 from home:coolo:appstream - !unchanged if rpmlint.log was new created - !unchanged if appdata.xml was new or updated OBS-URL: https://build.opensuse.org/request/show/105424 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=118 --- build-compare.changes | 6 ++++++ build-compare.spec | 5 ++--- same-build-result.sh | 25 +++++++++++++++++++++---- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/build-compare.changes b/build-compare.changes index 4bfb868..a498d54 100644 --- a/build-compare.changes +++ b/build-compare.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Feb 16 13:39:21 UTC 2012 - coolo@suse.com + +- !unchanged if rpmlint.log was new created +- !unchanged if appdata.xml was new or updated + ------------------------------------------------------------------- Mon Feb 6 11:53:57 UTC 2012 - aj@suse.de diff --git a/build-compare.spec b/build-compare.spec index 377db3b..c10f693 100644 --- a/build-compare.spec +++ b/build-compare.spec @@ -16,13 +16,12 @@ # - Name: build-compare +Summary: Build Result Compare Script License: GPL-2.0+ Group: Development/Tools/Building -Summary: Build Result Compare Script Version: 2012.01.26 -Release: 6 +Release: 0 Source1: COPYING Source2: same-build-result.sh Source3: rpm-check.sh diff --git a/same-build-result.sh b/same-build-result.sh index 1f7e40a..599e7fe 100644 --- a/same-build-result.sh +++ b/same-build-result.sh @@ -90,16 +90,16 @@ if [ -n "${NEWRPMS[0]}" ]; then fi # Compare rpmlint.log files -RPMLINTDIR=/home/abuild/rpmbuild/OTHER +OTHERDIR=/home/abuild/rpmbuild/OTHER -if test -e $OLDDIR/rpmlint.log -a -e $RPMLINTDIR/rpmlint.log; then +if test -e $OLDDIR/rpmlint.log -a -e $OTHERDIR/rpmlint.log; then file1=`mktemp` file2=`mktemp` - echo "comparing $OLDDIR/rpmlint.log and $RPMLINTDIR/rpmlint.log" + echo "comparing $OLDDIR/rpmlint.log and $OTHERDIR/rpmlint.log" # Sort the files first since the order of messages is not deterministic # Remove release from files sort -u $OLDDIR/rpmlint.log|sed -e "s,$release1,@RELEASE@,g" -e "s|/tmp/rpmlint\..*spec|.spec|g" > $file1 - sort -u $RPMLINTDIR/rpmlint.log|sed -e "s,$release2,@RELEASE@,g" -e "s|/tmp/rpmlint\..*spec|.spec|g" > $file2 + sort -u $OTHERDIR/rpmlint.log|sed -e "s,$release2,@RELEASE@,g" -e "s|/tmp/rpmlint\..*spec|.spec|g" > $file2 if ! cmp -s $file1 $file2; then echo "rpmlint.log files differ:" # File is sorted, so don't give context that will confuse readers @@ -107,6 +107,23 @@ if test -e $OLDDIR/rpmlint.log -a -e $RPMLINTDIR/rpmlint.log; then SUCCESS=0 fi rm $file1 $file2 +elif -e $OTHERDIR/rpmlint.log; then + echo "rpmlint.log is new" + 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 + SUCCESS=0 + fi +elif -e $OTHERDIR/appdata.xml; then + echo "appdata.xml is new" + SUCCESS=0 fi if test $SUCCESS -eq 0; then From 79431e7c5cbd0e589e6e66a0fb8556c20282e1f5365e532fa4e316e6f7e840e3 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Thu, 16 Feb 2012 14:19:23 +0000 Subject: [PATCH 2/2] don't show diff of sorted files OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=119 --- same-build-result.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/same-build-result.sh b/same-build-result.sh index 599e7fe..a1e718b 100644 --- a/same-build-result.sh +++ b/same-build-result.sh @@ -102,8 +102,7 @@ if test -e $OLDDIR/rpmlint.log -a -e $OTHERDIR/rpmlint.log; then sort -u $OTHERDIR/rpmlint.log|sed -e "s,$release2,@RELEASE@,g" -e "s|/tmp/rpmlint\..*spec|.spec|g" > $file2 if ! cmp -s $file1 $file2; then echo "rpmlint.log files differ:" - # File is sorted, so don't give context that will confuse readers - diff -u0 $file1 $file2 |head -n 20 + diff -u $OLDDIR/rpmlint.log $OTHERDIR/rpmlint.log |head -n 20 SUCCESS=0 fi rm $file1 $file2