From a01c32558f64b8d3ca6730a6f03f4f45fb468da0b670f8a412169f3e37ae625c Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Mon, 6 Feb 2012 10:15:46 +0000 Subject: [PATCH 1/2] Accepting request 102853 from home:a_jaeger:branches:build-compare-test Improve handling of manpages and rpmlint files. OBS-URL: https://build.opensuse.org/request/show/102853 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=115 --- build-compare.changes | 22 ++++++++++++++++++++++ rpm-check.sh | 14 ++++++++++++-- same-build-result.sh | 9 ++++++--- 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/build-compare.changes b/build-compare.changes index 366fab3..f78003a 100644 --- a/build-compare.changes +++ b/build-compare.changes @@ -1,3 +1,25 @@ +------------------------------------------------------------------- +Sun Feb 5 12:16:49 UTC 2012 - aj@suse.de + +- Improve rpmlint check. + +------------------------------------------------------------------- +Sun Feb 5 12:11:35 UTC 2012 - aj@suse.de + +- Take care of date format change of unzip. + +------------------------------------------------------------------- +Sun Feb 5 10:43:49 UTC 2012 - aj@suse.de + +- Replace all occurences of release in rpmlint, take care of + temporary files in rpmlint + +------------------------------------------------------------------- +Sun Feb 5 09:23:56 UTC 2012 - aj@suse.de + +- Use separate invocation lines for .TH lines to catch + some better. + ------------------------------------------------------------------- Thu Jan 26 10:01:55 UTC 2012 - aj@suse.de diff --git a/rpm-check.sh b/rpm-check.sh index c9c894d..a375503 100644 --- a/rpm-check.sh +++ b/rpm-check.sh @@ -190,9 +190,12 @@ check_single_file() unjar_l ./$file |sort > flist # 10-05-2010 14:39 sed -i -e "s, [0-9][0-9]-[0-9][0-9]-[0-9]\+ [0-9][0-9]:[0-9][0-9] , date ," flist + # 2012-02-03 07:59 + sed -i -e "s, 20[0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] , date ," flist cd ../new unjar_l ./$file |sort> flist sed -i -e "s, [0-9][0-9]-[0-9][0-9]-[0-9]\+ [0-9][0-9]:[0-9][0-9] , date ,; " flist + sed -i -e "s, 20[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 echo "$file has different file list" @@ -318,14 +321,21 @@ check_single_file() # .TH "appender.h" 3 "Tue Aug 31 2010" "Version 1.2.1" "log4c" \" -*- nroff -*- # .TH "OFFLINEIMAP" "1" "11 May 2010" "John Goerzen" "OfflineIMAP Manual" # .TH gv 3guile "13 May 2010" - # .TH ARCH "1" "September 2010" "GNU coreutils 8.5" "User Commands" #.TH "GIT\-ARCHIMPORT" "1" "09/13/2010" "Git 1\&.7\&.1" "Git Manual" # .TH LDIRECTORD 8 "2010-10-20" "perl v5.12.2" "User Contributed Perl Documentation" for f in old/$file new/$file; do - sed -i -e 's|.TH "\?\([^ "]*\)"\? "\?\([0-9][a-z]*\)"\? "\?\(20[0-9][0-9]-[0-9][0-9]-[0-9][0-9]\|[A-Z][a-z]* [0-9][0-9], 20[0-9][0-9]\|[0-9]* [A-Z][a-z]* 20[0-9][0-9]\|[A-Z][a-z][a-z] [A-Z][a-z][a-z] [0-9]\+ 20[0-9][0-9]\|[A-Z][a-z]* 20[0-9][0-9]\)"\? |.TH \1 \2 "2000-01-01" |' $f + sed -i -e 's|.TH "\?\([^ "]*\)"\? "\?\([0-9][a-z]*\)"\? "\?\(20[0-9][0-9]-[0-9][0-9]-[0-9][0-9]\|[0-9]* [A-Z][a-z]* 20[0-9][0-9]\)"\? |.TH \1 \2 "2000-01-01" |' $f sed -i -e 's|.TH "\?\([^ "]*\)"\? "\?\([0-9][a-z]*\)"\? "\?\([0-1][0-9]/[0-9][0-9]/201[0-9]\)"\? |.TH \1 \2 "2000-01-01" |' $f sed -i -e 's|.TH \(.*\) "\?\(20[0-1][0-9]-[0-9][0-9]-[0-9][0-9]\)"\? |.TH \1 "2000-01-01" |' $f + # .TH ccmake 1 "February 05, 2012" "ccmake 2.8.7" + sed -i -e 's|^.TH "\?\([^ "]*\)"\? "\?\([0-9][a-z]*\)"\? "\?\([A-Z][a-z]* [0-9][0-9], 20[0-9][0-9]\)"\? |.TH \1 \2 "2000-01-01" |' $f + # .TH "appender.h" 3 "Tue Aug 31 2010" "Version 1.2.1" "log4c" \" -*- nroff -*- + sed -i -e 's|.TH "\?\([^ "]*\)"\? "\?\([0-9][a-z]*\)"\? "\?[A-Z][a-z][a-z] [A-Z][a-z][a-z] [0-9]\+ 20[0-9][0-9]"\? |.TH \1 \2 "2000-01-01" |' $f + # .TH ARCH "1" "September 2010" "GNU coreutils 8.5" "User Commands" + sed -i -e 's|.TH "\?\([^ "]*\)"\? "\?\([0-9][a-z]*\)"\? "\?[A-Z][a-z]* 20[0-9][0-9]"\? |.TH \1 \2 "2000-01-01" |' $f + # .TH "GCM-CALIBRATE" "1" "03 February 2012" "" "" + sed -i -e 's|.TH "\?\([^ "]*\)"\? "\?\([0-9][a-z]*\)"\? "\?[0-9]* [A-Z][a-z]* 20[0-9][0-9]"\? |.TH \1 \2 "2000-01-01" |' $f # generated by docbook xml: #.\" Date: 09/13/2010 sed -i -e 's|Date: [0-1][0-9]/[0-9][0-9]/201[0-9]|Date: 09/13/2010|' $f diff --git a/same-build-result.sh b/same-build-result.sh index 317a962..84306b8 100644 --- a/same-build-result.sh +++ b/same-build-result.sh @@ -98,11 +98,14 @@ if test -e $OLDDIR/rpmlint.log -a -e $RPMLINTDIR/rpmlint.log; then echo "comparing $OLDDIR/rpmlint.log and $RPMLINTDIR/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@," > $file1 - sort -u $RPMLINTDIR/rpmlint.log|sed -e "s,$release2, @RELEASE@," > $file2 + echo "Release1 is $release1, Release2 is $release2" + 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 if ! cmp -s $file1 $file2; then echo "rpmlint.log files differ:" - diff -u $OLDDIR/rpmlint.log $RPMLINTDIR/rpmlint.log|head -n 20 + # File is sorted, so don't give context that will confuse readers + diff -u0 $file1 $file2 |head -n 20 + #diff -u $OLDDIR/rpmlint.log $RPMLINTDIR/rpmlint.log|head -n 20 SUCCESS=0 fi rm $file1 $file2 From c0275a0a8184aa4d2a6f0a204b73f84cee9025400ea7fcd84833255d326c359d Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Mon, 6 Feb 2012 12:47:20 +0000 Subject: [PATCH 2/2] Accepting request 102885 from home:a_jaeger:branches:build-compare-test Fix bug in rpmlint handling OBS-URL: https://build.opensuse.org/request/show/102885 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=116 --- build-compare.changes | 6 ++++++ same-build-result.sh | 6 ++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/build-compare.changes b/build-compare.changes index f78003a..4bfb868 100644 --- a/build-compare.changes +++ b/build-compare.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Feb 6 11:53:57 UTC 2012 - aj@suse.de + +- Fix off-by-one error in rpmlint processing that hit packages with + just one binary package. + ------------------------------------------------------------------- Sun Feb 5 12:16:49 UTC 2012 - aj@suse.de diff --git a/same-build-result.sh b/same-build-result.sh index 84306b8..1f7e40a 100644 --- a/same-build-result.sh +++ b/same-build-result.sh @@ -63,8 +63,8 @@ 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[1]}"` -release2=`rpm -qp --nodigest --nosignature --qf "%{RELEASE}" "${NEWRPMS[1]}"` +release1=`rpm -qp --nodigest --nosignature --qf "%{RELEASE}" "${OLDRPMS[0]}"` +release2=`rpm -qp --nodigest --nosignature --qf "%{RELEASE}" "${NEWRPMS[0]}"` SUCCESS=1 rpmqp='rpm -qp --qf %{NAME} --nodigest --nosignature ' @@ -98,14 +98,12 @@ if test -e $OLDDIR/rpmlint.log -a -e $RPMLINTDIR/rpmlint.log; then echo "comparing $OLDDIR/rpmlint.log and $RPMLINTDIR/rpmlint.log" # Sort the files first since the order of messages is not deterministic # Remove release from files - echo "Release1 is $release1, Release2 is $release2" 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 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 $RPMLINTDIR/rpmlint.log|head -n 20 SUCCESS=0 fi rm $file1 $file2