From 393948f2a4e438f7aac4e9e1a34681d47242e43c7708da6b3c829fa9a317e697 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Mon, 13 Apr 2015 08:56:50 +0000 Subject: [PATCH] - Show hint if pkg-diff.sh returns non-zero - Adjust intending in same-build-result.sh - Handle /usr/src/packages/OTHER - Handle "setuid directory" OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=179 --- build-compare.changes | 8 +++++ pkg-diff.sh | 2 +- same-build-result.sh | 82 ++++++++++++++++++++++++------------------- 3 files changed, 55 insertions(+), 37 deletions(-) diff --git a/build-compare.changes b/build-compare.changes index 1d96851..af86a58 100644 --- a/build-compare.changes +++ b/build-compare.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Apr 13 08:55:39 UTC 2015 - olaf@aepfle.de + +- Show hint if pkg-diff.sh returns non-zero +- Adjust intending in same-build-result.sh +- Handle /usr/src/packages/OTHER +- Handle "setuid directory" + ------------------------------------------------------------------- Fri Mar 20 18:58:22 UTC 2015 - olaf@aepfle.de diff --git a/pkg-diff.sh b/pkg-diff.sh index 5848e0a..65157b7 100644 --- a/pkg-diff.sh +++ b/pkg-diff.sh @@ -689,7 +689,7 @@ check_single_file() return 1 fi ;; - directory|setuid,\ directory|sticky,\ directory) + directory|setuid\ directory|setuid,\ directory|sticky,\ directory) # tar might package directories - ignore them here return 0 ;; diff --git a/same-build-result.sh b/same-build-result.sh index ae0c463..33fd9ea 100644 --- a/same-build-result.sh +++ b/same-build-result.sh @@ -76,18 +76,19 @@ for opac in ${OLDRPMS[*]}; do oname=`$rpmqp $opac` nname=`$rpmqp $npac` if test "$oname" != "$nname"; then - echo "names differ: $oname $nname" - exit 1 + echo "names differ: $oname $nname" + exit 1 fi case "$opac" in *debuginfo*) - echo "skipping -debuginfo package" + echo "skipping -debuginfo package" ;; *) - bash $CMPSCRIPT "$opac" "$npac" || SUCCESS=0 - if test $SUCCESS -eq 0 -a -z "$check_all"; then + bash $CMPSCRIPT "$opac" "$npac" || SUCCESS=0 + if test $SUCCESS -eq 0 -a -z "$check_all"; then + echo "differences between $opac and $npac" exit 1 - fi + fi ;; esac done @@ -98,43 +99,52 @@ if [ -n "${NEWRPMS[0]}" ]; then fi # Compare rpmlint.log files -OTHERDIR=/home/abuild/rpmbuild/OTHER - -if test -e $OLDDIR/rpmlint.log -a -e $OTHERDIR/rpmlint.log; then - file1=`mktemp` - file2=`mktemp` - 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,$ver_rel1,@VERSION@-@RELEASE@,g" -e "s|/tmp/rpmlint\..*spec|.spec|g" > $file1 - sort -u $OTHERDIR/rpmlint.log|sed -e "s,$ver_rel2,@VERSION@-@RELEASE@,g" -e "s|/tmp/rpmlint\..*spec|.spec|g" > $file2 - if ! cmp -s $file1 $file2; then - echo "rpmlint.log files differ:" - diff -u $file1 $file2 |head -n 20 - SUCCESS=0 - fi - rm $file1 $file2 -elif test -e $OTHERDIR/rpmlint.log; then - echo "rpmlint.log is new" - SUCCESS=0 +if test -d /home/abuild/rpmbuild/OTHER; then + OTHERDIR=/home/abuild/rpmbuild/OTHER +elif test -d /usr/src/packages/OTHER + OTHERDIR=/usr/src/packages/OTHER +else + echo "no OTHERDIR" + OTHERDIR= fi -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 test -n "$OTHERDIR"; then + if test -e $OLDDIR/rpmlint.log -a -e $OTHERDIR/rpmlint.log; then + file1=`mktemp` + file2=`mktemp` + 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,$ver_rel1,@VERSION@-@RELEASE@,g" -e "s|/tmp/rpmlint\..*spec|.spec|g" > $file1 + sort -u $OTHERDIR/rpmlint.log|sed -e "s,$ver_rel2,@VERSION@-@RELEASE@,g" -e "s|/tmp/rpmlint\..*spec|.spec|g" > $file2 if ! cmp -s $file1 $file2; then - echo "$xml files differ:" - diff -u0 $file1 $file2 |head -n 20 + echo "rpmlint.log files differ:" + diff -u $file1 $file2 |head -n 20 SUCCESS=0 fi - elif test -e $OTHERDIR/$xml; then - echo "$xml is new" + rm $file1 $file2 + elif test -e $OTHERDIR/rpmlint.log; then + echo "rpmlint.log is new" SUCCESS=0 fi -done + + 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 + done +fi if test $SUCCESS -eq 0; then exit 1