From ab4f8379cd8206d0d0505480a8aefaae45c38fd2cc25e516efc71be50c5f3979 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Wed, 22 Feb 2012 11:24:20 +0000 Subject: [PATCH] Accepting request 106436 from home:a_jaeger:branches:build-compare-test Remove release from pre/post scripts OBS-URL: https://build.opensuse.org/request/show/106436 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=125 --- build-compare.changes | 5 +++++ build-compare.spec | 1 + functions.sh | 15 ++++++++++++--- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/build-compare.changes b/build-compare.changes index 4300c1f..3a2f99c 100644 --- a/build-compare.changes +++ b/build-compare.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +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 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 17ba192..48ac53d 100644 --- a/functions.sh +++ b/functions.sh @@ -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,8 +62,7 @@ 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*) @@ -99,6 +98,16 @@ function cmp_spec () check_provides $oldrpm $release1 > $file1 check_provides $newrpm $release2 > $file2 + if ! diff -au $file1 $file2; then + rm $file1 $file2 + 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