Accepting request 106437 from openSUSE:Tools

Remove release from pre/post scripts (forwarded request 106436 from a_jaeger)

OBS-URL: https://build.opensuse.org/request/show/106437
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/build-compare?expand=0&rev=67
This commit is contained in:
Stephan Kulow 2012-02-22 14:52:50 +00:00 committed by Git OBS Bridge
commit 8fb4c94516
4 changed files with 49 additions and 18 deletions

View File

@ -1,3 +1,19 @@
-------------------------------------------------------------------
Wed Feb 22 11:12:13 UTC 2012 - aj@suse.de
- Remove release from pre/post scripts.
-------------------------------------------------------------------
Wed Feb 22 11:07:53 UTC 2012 - coolo@suse.com
- I changed my mind, appdata.xml is too hard to get right. So
we need to support variable binary names for the appdata
-------------------------------------------------------------------
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

View File

@ -16,6 +16,7 @@
#
Name: build-compare
Summary: Build Result Compare Script
License: GPL-2.0+

View File

@ -1,6 +1,6 @@
#! /bin/bash
#
# Copyright (c) 2009, 2010, 2011 SUSE Linux Product GmbH, Germany.
# Copyright (c) 2009, 2010, 2011, 2012 SUSE Linux Product GmbH, Germany.
# Licensed under GPL v2, see COPYING file for details.
#
# Written by Michael Matz and Stephan Coolo
@ -62,7 +62,6 @@ function cmp_spec ()
QF="$QF %{EXCLUSIVEOS} %{RPMVERSION} %{PLATFORM}\\n"
QF="$QF %{PAYLOADFORMAT} %{PAYLOADCOMPRESSOR} %{PAYLOADFLAGS}\\n"
QF="$QF [%{PREINPROG} %{PREIN}\\n]\\n[%{POSTINPROG} %{POSTIN}\\n]\\n[%{PREUNPROG} %{PREUN}\\n]\\n[%{POSTUNPROG} %{POSTUN}\\n]\\n"
# XXX We also need to check the existence (but not the content (!))
# of SIGGPG (and perhaps the other SIG*)
@ -87,8 +86,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"
@ -103,6 +103,16 @@ function cmp_spec ()
return 1
fi
# scripts, might contain release number
QF="[%{PREINPROG} %{PREIN}\\n]\\n[%{POSTINPROG} %{POSTIN}\\n]\\n[%{PREUNPROG} %{PREUN}\\n]\\n[%{POSTUNPROG} %{POSTUN}\\n]\\n"
check_header $oldrpm | sed -e "s,-$release1$,-@RELEASE@," > $file1
check_header $newrpm | sed -e "s,-$release2$,-@RELEASE@," > $file2
if ! diff -au $file1 $file2; then
rm $file1 $file2
return 1
fi
# First check the file attributes and later the md5s
# Now the files. We leave out mtime and size. For normal files

View File

@ -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 '
@ -111,19 +112,22 @@ elif test -e $OTHERDIR/rpmlint.log; then
SUCCESS=0
fi
# compare appstream data
if test -e $OLDDIR/appdata.xml -a -e $OTHERDIR/appdata.xml; then
file1=$OLDDIR/appdata.xml
file2=$OTHERDIR/appdata.xml
if ! cmp -s $file1 $file2; then
echo "appdata.xml files differ:"
diff -u0 $file1 $file2 |head -n 20
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
elif test -e $OTHERDIR/appdata.xml; then
echo "appdata.xml is new"
SUCCESS=0
fi
done
if test $SUCCESS -eq 0; then
exit 1