diff --git a/build-compare.changes b/build-compare.changes index a632116..878a991 100644 --- a/build-compare.changes +++ b/build-compare.changes @@ -1,3 +1,28 @@ +------------------------------------------------------------------- +Thu Jul 23 15:30:30 CEST 2009 - aj@suse.de + +- Update version number. + +------------------------------------------------------------------- +Tue Jul 21 16:41:39 CEST 2009 - aj@suse.de + +- Handle emacs bytecompiled files. +- Handle /usr/share/man/man3/*3pm perl man pages. +- Handle /var/adm/perl-modules/*. +- Handle fonts.dir, fonts.scale and encoding.dir. + +------------------------------------------------------------------- +Tue Jul 21 13:02:36 CEST 2009 - aj@suse.de + +- Add return value for .a case so that it can succeed. + +------------------------------------------------------------------- +Mon Jul 20 15:50:46 CEST 2009 - aj@suse.de + +- Fix typo in same-build-results.sh +- Ignore javadoc build stamp in javadoc html files. +- Use jar,fastjar or unzip to extract jar files. + ------------------------------------------------------------------- Wed Jul 15 13:31:30 CEST 2009 - coolo@novell.com diff --git a/build-compare.spec b/build-compare.spec index 9095ce2..7a44fe8 100644 --- a/build-compare.spec +++ b/build-compare.spec @@ -1,5 +1,5 @@ # -# spec file for package build-compare (Version 2009.01.27) +# spec file for package build-compare (Version 2009.07.23) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -23,8 +23,8 @@ License: GPL v2 or later Group: Development/Tools/Building AutoReqProv: on Summary: Build Result Compare Script -Version: 2009.01.27 -Release: 10 +Version: 2009.07.23 +Release: 1 Source: same-build-result.sh Source1: rpm-check.sh Source2: COPYING diff --git a/rpm-check.sh b/rpm-check.sh index 42e7bfe..07f694c 100644 --- a/rpm-check.sh +++ b/rpm-check.sh @@ -1,10 +1,11 @@ #! /bin/bash # # Copyright (c) 2009 SUSE Linux Product Gmbh, Germany. - # Licensed under GPL v2, see COPYING file for details. +# Licensed under GPL v2, see COPYING file for details. # # Written by Michael Matz and Stephan Coolo -# +# Enhanced by Andreas Jaeger + RPM="rpm -qp --nodigest --nosignature" check_all= @@ -32,6 +33,62 @@ if test ! -f $newrpm; then exit 1 fi +#usage unjar +function unjar() +{ + local file + file=$1 + + if [[ $(type -p fastjar) ]]; then + UNJAR=fastjar + elif [[ $(type -p jar) ]]; then + UNJAR=jar + elif [[ $(type -p unzip) ]]; then + UNJAR=unzip + else + echo "ERROR: jar, fastjar, or unzip is not installed (trying file $file)" + exit 1 + fi + + case $UNJAR in + jar|fastjar) + # echo jar -xf $file + ${UNJAR} -xf $file + ;; + unzip) + unzip -oqq $file + ;; + esac +} + +# list files in directory +#usage unjar_l +function unjar_l() +{ + local file + file=$1 + + if [[ $(type -p fastjar) ]]; then + UNJAR=fastjar + elif [[ $(type -p jar) ]]; then + UNJAR=jar + elif [[ $(type -p unzip) ]]; then + UNJAR=unzip + else + echo "ERROR: jar, fastjar, or unzip is not installed (trying file $file)" + exit 1 + fi + + case $UNJAR in + jar|fastjar) + ${UNJAR} -tf $file + ;; + unzip) + unzip -l $file + ;; + esac +} + filter_disasm() { sed -e 's/^ *[0-9a-f]\+://' -e 's/\$0x[0-9a-f]\+/$something/' -e 's/callq *[0-9a-f]\+/callq /' -e 's/# *[0-9a-f]\+/# /' -e 's/\(0x\)\?[0-9a-f]\+(/offset(/' -e 's/[0-9a-f]\+ :/\1:/' -e 's/<\(.*\)+0x[0-9a-f]\+>/<\1 + ofs>/' @@ -175,6 +232,7 @@ check_single_file() echo "mono files unhandled ($file)" return 1;; *.a) + echo "$file is .a" flist=`ar t new/$file` pwd=$PWD fdir=`dirname $file` @@ -188,6 +246,7 @@ check_single_file() return 1 fi done + return 0 ;; *.tar|*.tar.bz2|*.tar.gz|*.tgz|*.tbz2) flist=`tar tf new/$file` @@ -210,10 +269,10 @@ check_single_file() return $ret;; *.zip|*.jar) cd old - unzip -l ./$file > flist + unjar_l ./$file > flist sed -i -e "s, [0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] , date ," flist cd ../new - unzip -l ./$file > flist + unjar_l ./$file > flist sed -i -e "s, [0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] , date ,; " flist cd .. if ! cmp -s old/flist new/flist; then @@ -225,9 +284,9 @@ check_single_file() pwd=$PWD fdir=`dirname $file` cd old/$fdir - unzip -o -qq `basename $file` + unjar `basename $file` cd $pwd/new/$fdir - unzip -o -qq `basename $file` + unjar `basename $file` cd $pwd local ret=0 for f in $flist; do @@ -253,11 +312,62 @@ check_single_file() gunzip -c old/$file > old/${file/.gz/} gunzip -c new/$file > new/${file/.gz/} check_single_file ${file/.gz/} - return $? + return $? ;; /usr/share/locale/*/LC_MESSAGES/*.mo|/usr/share/locale-bundle/*/LC_MESSAGES/*.mo) - sed -i -e "s,POT-Creation-Date: ....-..-.. ..:..+....,POT-Creation-Date: 1970-01-01 00:00+0000," old/$file - sed -i -e "s,POT-Creation-Date: ....-..-.. ..:..+....,POT-Creation-Date: 1970-01-01 00:00+0000," new/$file + for f in old/$file new/$file; do + sed -i -e "s,POT-Creation-Date: ....-..-.. ..:..+....,POT-Creation-Date: 1970-01-01 00:00+0000," $f + done + ;; + /usr/share/javadoc/*/*.html|/usr/share/javadoc/*/*/*.html) + # There are more timestamps in html, so far we handle only some primitive versions. + for f in old/$file new/$file; do + # Javadoc: + sed -i -e "s,^,^," $f + sed -i -e 's|^$||' $f + sed -i -e 's|||' $f + # Gjdoc HtmlDoclet: + sed -i -e 's|Generated by Gjdoc HtmlDoclet 0...., part of GNU Classpath Tools, on .* .., 20.. ..:..:.. ..m. GMT.|Generated by Gjdoc.|' $f + done + ;; + */fonts.scale|*/fonts.dir|*/encodings.dir) + for f in old/$file new/$file; do + # sort files before comparing + sort $f > $f.tmp + mv $f.tmp $f + done + ;; + /var/adm/perl-modules/*) + for f in old/$file new/$file; do + sed -i -e 's|^=head2 ... ... .. ..:..:.. ....: C|=head2 Wed Jul 1 00:00:00 2009: C|' $f + done + ;; + /usr/share/man/man3/*3pm) + for f in old/$file new/$file; do + sed -i -e 's| 3 "20..-..-.." "perl v5....." "User Contributed Perl Documentation"$| 3 "2009-01-01" "perl v5.10.0" "User Contributed Perl Documentation"|' $f + done + ;; + *.elc) + # emacs lisp files + for f in old/$file new/$file; do + sed -i -e 's|Compiled by abuild@.* on ... ... .. ..:..:.. 20..$|compiled by abuild@buildhost on Wed Jul 01 00:00:00 2009|' $f + done + ;; + /var/lib/texmf/web2c/*/*fmt) + # same of these are gzip compressed + for f in old/$file new/$file; do + fftype=`/usr/bin/file $f | cut -d: -f2-` + case $fftype in + *gzip\ compressed\ data*) + gunzip -cd $f > $f.tmp + mv $f.tmp $f + ;; + *) + ;; + esac + # date is of variable length, e.g. 2009.7.21 + sed -i -e 's|(format=[a-z]*tex 20..\.[0-9]*\.[0-9]*)|(format=luatex 2009.1.1)|' $f + done ;; esac @@ -301,7 +411,7 @@ check_single_file() ;; *) if ! diff_two_files; then - return 1 + return 1 fi ;; esac @@ -313,7 +423,7 @@ for file in $files; do if ! check_single_file $file; then ret=1 if test -z "$check_all"; then - break + break fi fi done diff --git a/same-build-result.sh b/same-build-result.sh index 989a3b8..8ed5a53 100644 --- a/same-build-result.sh +++ b/same-build-result.sh @@ -72,6 +72,6 @@ if [ -n "${NEWRPMS[0]}" ]; then exit 1 fi -echo compare validated built as indentical ! +echo compare validated built as identical ! exit 0