From 5f0dcc813104c36256ccbba30acab89efa4a2128cdd31c12219a8162b768bb74 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Thu, 17 Jul 2014 18:31:37 +0000 Subject: [PATCH] Accepting request 241368 from home:msmeissn:branches:openSUSE:Tools - Allow file list changes where the release number is encoded in the filename. - compare post-update message and scripts (fixes fetchmsttfonts constant republish) as they have the release number hardcoded. OBS-URL: https://build.opensuse.org/request/show/241368 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=145 --- build-compare.changes | 8 ++++++++ functions.sh | 13 +++++++------ rpm-check.sh | 15 +++++++++++++++ 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/build-compare.changes b/build-compare.changes index 53cde58..edc9e0c 100644 --- a/build-compare.changes +++ b/build-compare.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Jul 17 06:46:47 UTC 2014 - meissner@suse.com + +- Allow file list changes where the release number is encoded + in the filename. +- compare post-update message and scripts (fixes fetchmsttfonts + constant republish) as they have the release number hardcoded. + ------------------------------------------------------------------- Tue Jul 15 11:42:09 CEST 2014 - ohering@suse.de diff --git a/functions.sh b/functions.sh index 48ac53d..1ad1bcf 100644 --- a/functions.sh +++ b/functions.sh @@ -125,9 +125,9 @@ function cmp_spec () # Also FILELANGS (or?) QF="[%{FILENAMES} %{FILEFLAGS} %{FILESTATES} %{FILEMODES:octal} %{FILEUSERNAME} %{FILEGROUPNAME} %{FILERDEVS} %{FILEVERIFYFLAGS} %{FILELINKTOS}\n]\\n" # ??? what to do with FILEPROVIDE and FILEREQUIRE? - - check_header $oldrpm > $file1 - check_header $newrpm > $file2 + + 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 @@ -136,9 +136,10 @@ function cmp_spec () # now the md5sums. if they are different, we check more detailed # if there are different filenames, we will already have aborted before - QF="[%{FILENAMES} %{FILEMD5S}\n]\\n" - check_header $oldrpm > $file1 - check_header $newrpm > $file2 + # file flag 64 means "ghost", filter those out. + QF="[%{FILENAMES} %{FILEMD5S} %{FILEFLAGS}\n]\\n" + check_header $oldrpm |grep -v " 64$"> $file1 + check_header $newrpm |grep -v " 64$"> $file2 RES=2 # done if the same diff --git a/rpm-check.sh b/rpm-check.sh index 58d824a..0494b71 100644 --- a/rpm-check.sh +++ b/rpm-check.sh @@ -402,6 +402,21 @@ check_single_file() echo "Ignore $file" return 0 ;; + /var/adm/update-messages/*|/var/adm/update-scripts/*) + # encode version-release inside + oldfn=`echo "$file"|sed -e s/-$release2/-$release1/;` + + # fetchmsttfonts embeds the release number in the update shell script. + echo sed -i -e "s/-$release1/-$release2/g;" "old/$oldfn" + sed -i -e "s/-$release1/-$release2/g;" "old/$oldfn" + + if ! diff -u old/$oldfn new/$file; then + echo "$oldfn is not same as $file" + return 1 + fi + echo "$file and $oldfn are same" + return 0 + ;; *pdf) # PDF files contain a unique ID, remove it # Format of the ID is: