From d521ef89cd51486b76f1b63123892299c7a06347454b229f0167daf84c47314d Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Wed, 22 Feb 2012 07:49:21 +0000 Subject: [PATCH] Accepting request 106406 from home:a_jaeger:branches:build-compare-test Quote dot in release to not have false matches OBS-URL: https://build.opensuse.org/request/show/106406 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=123 --- build-compare.changes | 5 +++++ build-compare.spec | 1 + functions.sh | 5 +++-- same-build-result.sh | 5 +++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/build-compare.changes b/build-compare.changes index 79daad7..8078b4c 100644 --- a/build-compare.changes +++ b/build-compare.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Feb 18 18:27:40 UTC 2012 - aj@suse.de + +- Quote dot in release to not have false matches. + ------------------------------------------------------------------- Thu Feb 16 21:00:31 UTC 2012 - coolo@suse.com diff --git a/build-compare.spec b/build-compare.spec index c10f693..e388fcf 100644 --- a/build-compare.spec +++ b/build-compare.spec @@ -16,6 +16,7 @@ # + Name: build-compare Summary: Build Result Compare Script License: GPL-2.0+ diff --git a/functions.sh b/functions.sh index 8f75b00..17ba192 100644 --- a/functions.sh +++ b/functions.sh @@ -87,8 +87,9 @@ function cmp_spec () return 1 fi - release1=`$RPM --qf "%{RELEASE}" "$oldrpm"` - release2=`$RPM --qf "%{RELEASE}" "$newrpm"` + # Remember to quote the . which is in release + release1=`$RPM --qf "%{RELEASE}" "$oldrpm"|sed -e 's/\./\\./g'` + release2=`$RPM --qf "%{RELEASE}" "$newrpm"|sed -e 's/\./\\./g'` # This might happen with a forced rebuild of factory if [ "${release1%.*}" != "${release2%.*}" ] ; then echo "release prefix mismatch" diff --git a/same-build-result.sh b/same-build-result.sh index db630b1..cfc6c1a 100644 --- a/same-build-result.sh +++ b/same-build-result.sh @@ -63,8 +63,9 @@ 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[0]}"` -release2=`rpm -qp --nodigest --nosignature --qf "%{RELEASE}" "${NEWRPMS[0]}"` +# Remember to quote the "." for future regexes +release1=`rpm -qp --nodigest --nosignature --qf "%{RELEASE}" "${OLDRPMS[0]}"|sed -e 's/\./\\./g'` +release2=`rpm -qp --nodigest --nosignature --qf "%{RELEASE}" "${NEWRPMS[0]}"|sed -e 's/\./\\./g'` SUCCESS=1 rpmqp='rpm -qp --qf %{NAME} --nodigest --nosignature '