diff --git a/build-compare.changes b/build-compare.changes index fedc250..0250d3b 100644 --- a/build-compare.changes +++ b/build-compare.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Feb 5 17:34:29 CET 2009 - coolo@suse.de + +- fix 2 bugs +- don't ignore source rpms - changed sources should output + changed source rpms, no matter if they create the same binaries + (think of changed copyright header in spec files) + ------------------------------------------------------------------- Tue Jan 27 14:27:19 CET 2009 - adrian@suse.de diff --git a/build-compare.spec b/build-compare.spec index 27ded91..f44e9e7 100644 --- a/build-compare.spec +++ b/build-compare.spec @@ -24,7 +24,7 @@ Group: Development/Tools/Building AutoReqProv: on Summary: Build Result Compare Script Version: 2009.01.27 -Release: 2 +Release: 3 Source: same-build-result.sh Source1: rpm-check.sh Source2: COPYING @@ -54,6 +54,11 @@ install -m 0644 %SOURCE2 $RPM_BUILD_ROOT/%_defaultdocdir/%name/ /usr/lib/build %changelog +* Thu Feb 05 2009 coolo@suse.de +- fix 2 bugs +- don't ignore source rpms - changed sources should output + changed source rpms, no matter if they create the same binaries + (think of changed copyright header in spec files) * Tue Jan 27 2009 adrian@suse.de - Create initial package based on the work of Matz and Coolo This package provides script for the main build script to be able diff --git a/rpm-check.sh b/rpm-check.sh index 6f895c8..1102edc 100644 --- a/rpm-check.sh +++ b/rpm-check.sh @@ -193,7 +193,7 @@ check_single_file() sed -i -e "s,new/,," $file2 if ! diff -u $file1 $file2 > $dfile; then echo "$file differs in assembler output" - head -n 2000 $dfile + head -n 200 $dfile ret=1 break fi @@ -213,7 +213,7 @@ check_single_file() *ASCII*|*text*) if ! cmp -s old/$file new/$file; then echo "$file differs ($ftype)" - diff -u old/$file1 new/$file2 | head -n 200 + diff -u old/$file new/$file | head -n 200 ret=1 break fi diff --git a/same-build-result.sh b/same-build-result.sh index 0dd9256..94e8f52 100644 --- a/same-build-result.sh +++ b/same-build-result.sh @@ -26,16 +26,42 @@ if [ -z "$NEWDIRS" ]; then exit 1 fi -#OLDRPMS=($(find "$OLDDIR" -name \*src.rpm|sort) $(find "$OLDDIR" -name \*rpm -a ! -name \*src.rpm|sort)) -#NEWRPMS=($(find $NEWDIRS -name \*src.rpm|sort) $(find $NEWDIRS -name \*rpm -a ! -name \*src.rpm|sort)) -# Exclude src rpms for now: +if test `find $NEWDIRS -name *.rpm | wc -l` != `find $OLDDIR -name *.rpm | wc -l`; then + echo "different number of subpackages" + find $OLDDIR $NEWDIRS -name *.rpm + exit 1 +fi + +osrpm=$(find "$OLDDIR" -name \*src.rpm) +nsrpm=$(find $NEWDIRS -name \*src.rpm) + +if test ! -f "$osrpm"; then + echo no old source rpm in $OLDDIR + exit 1 +fi + +if test ! -f "$nsrpm"; then + echo no new source rpm in $NEWDIRS + exit 1 +fi + +echo "compare $osrpm $nsrpm" +bash $CMPSCRIPT "$osrpm" "$nsrpm" || exit 1 + OLDRPMS=($(find "$OLDDIR" -name \*rpm -a ! -name \*src.rpm|sort)) NEWRPMS=($(find $NEWDIRS -name \*rpm -a ! -name \*src.rpm|sort)) -for opac in "$OLDRPMS"; do +rpmqp="rpm -qp --qf --nodigest --nosignature %{NAME}" +for opac in ${OLDRPMS[*]}; do npac=${NEWRPMS[0]} NEWRPMS=(${NEWRPMS[@]:1}) # shift echo compare "$opac" "$npac" + oname=`$rpmqp $opac` + nname=`$rpmqp $npac` + if test "$oname" != "$nname"; then + echo "names differ: $oname $nname" + exit 1 + fi bash $CMPSCRIPT "$opac" "$npac" || exit 1 done