forked from pool/build-compare
Updating link to change in openSUSE:Factory/build-compare revision 38.0
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=177826e63e9733d542d72a872b7677cf
This commit is contained in:
parent
0baab13ece
commit
3daece705b
@ -1,3 +1,25 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Sep 20 19:24:10 UTC 2010 - aj@suse.de
|
||||||
|
|
||||||
|
- Handle man pages generated from docbook.
|
||||||
|
- Handle rubygem documentation.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Sep 20 18:45:01 UTC 2010 - aj@suse.de
|
||||||
|
|
||||||
|
- Create common file functions.sh and cleanup code.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Sep 20 15:21:55 UTC 2010 - lnussel@suse.de
|
||||||
|
|
||||||
|
- exclude delta rpms
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Sep 20 07:58:59 UTC 2010 - aj@suse.de
|
||||||
|
|
||||||
|
- Create script for just checking source rpms.
|
||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Sep 9 20:02:33 UTC 2010 - aj@suse.de
|
Thu Sep 9 20:02:33 UTC 2010 - aj@suse.de
|
||||||
|
|
||||||
|
@ -24,10 +24,12 @@ Group: Development/Tools/Building
|
|||||||
AutoReqProv: on
|
AutoReqProv: on
|
||||||
Summary: Build Result Compare Script
|
Summary: Build Result Compare Script
|
||||||
Version: 2009.10.14
|
Version: 2009.10.14
|
||||||
Release: 21
|
Release: 22
|
||||||
Source: same-build-result.sh
|
Source1: COPYING
|
||||||
Source1: rpm-check.sh
|
Source2: same-build-result.sh
|
||||||
Source2: COPYING
|
Source3: rpm-check.sh
|
||||||
|
Source4: functions.sh
|
||||||
|
Source5: srpm-check.sh
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
@ -45,8 +47,8 @@ mkdir $RPM_BUILD_DIR/%name-%version
|
|||||||
|
|
||||||
%install
|
%install
|
||||||
mkdir -p $RPM_BUILD_ROOT/usr/lib/build/ $RPM_BUILD_ROOT/%_defaultdocdir/%name
|
mkdir -p $RPM_BUILD_ROOT/usr/lib/build/ $RPM_BUILD_ROOT/%_defaultdocdir/%name
|
||||||
install -m 0755 %SOURCE0 %SOURCE1 $RPM_BUILD_ROOT/usr/lib/build/
|
install -m 0755 %SOURCE2 %SOURCE3 %SOURCE4 %SOURCE5 $RPM_BUILD_ROOT/usr/lib/build/
|
||||||
install -m 0644 %SOURCE2 $RPM_BUILD_ROOT/%_defaultdocdir/%name/
|
install -m 0644 %SOURCE1 $RPM_BUILD_ROOT/%_defaultdocdir/%name/
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
|
138
functions.sh
Normal file
138
functions.sh
Normal file
@ -0,0 +1,138 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
#
|
||||||
|
# Copyright (c) 2009, 2010 SUSE Linux Product GmbH, Germany.
|
||||||
|
# Licensed under GPL v2, see COPYING file for details.
|
||||||
|
#
|
||||||
|
# Written by Michael Matz and Stephan Coolo
|
||||||
|
# Enhanced by Andreas Jaeger
|
||||||
|
|
||||||
|
# library of functions used by scripts
|
||||||
|
|
||||||
|
RPM="rpm -qp --nodigest --nosignature"
|
||||||
|
|
||||||
|
check_header()
|
||||||
|
{
|
||||||
|
$RPM --qf "$QF" "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
function check_provides()
|
||||||
|
{
|
||||||
|
|
||||||
|
# provides destroy this because at least the self-provide includes the
|
||||||
|
# -buildnumber :-(
|
||||||
|
QF="[%{PROVIDENAME} %{PROVIDEFLAGS} %{PROVIDEVERSION}\\n]\\n"
|
||||||
|
QF="$QF [%{REQUIRENAME} %{REQUIREFLAGS} %{REQUIREVERSION}\\n]\\n"
|
||||||
|
QF="$QF [%{CONFLICTNAME} %{CONFLICTFLAGS} %{CONFLICTVERSION}\\n]\\n"
|
||||||
|
QF="$QF [%{OBSOLETENAME} %{OBSOLETEFLAGS} %{OBSOLETEVERSION}\\n]\\n"
|
||||||
|
check_header "$1" | sed -e "s,-$2$,-@RELEASE@,"
|
||||||
|
}
|
||||||
|
|
||||||
|
#usage unrpm <file> $dir
|
||||||
|
# Unpack rpm files in directory $dir
|
||||||
|
# like /usr/bin/unrpm - just for one file and with no options
|
||||||
|
function unrpm()
|
||||||
|
{
|
||||||
|
local file
|
||||||
|
local dir
|
||||||
|
file=$1
|
||||||
|
dir=$2
|
||||||
|
CPIO_OPTS="--extract --unconditional --preserve-modification-time --make-directories --quiet"
|
||||||
|
mkdir -p $dir
|
||||||
|
pushd $dir 1>/dev/null
|
||||||
|
rpm2cpio $file | cpio ${CPIO_OPTS}
|
||||||
|
popd 1>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
# Compare just the rpm meta data of two rpms
|
||||||
|
# Returns:
|
||||||
|
# 0 in case of same content
|
||||||
|
# 1 in case of errors or difference
|
||||||
|
# 2 in case of differences that need further investigation
|
||||||
|
# Sets $files with list of files that need further investigation
|
||||||
|
function cmp_spec ()
|
||||||
|
{
|
||||||
|
QF="%{NAME}"
|
||||||
|
|
||||||
|
# don't look at RELEASE, it contains our build number
|
||||||
|
QF="$QF %{VERSION} %{EPOCH}\\n"
|
||||||
|
QF="$QF %{SUMMARY}\\n%{DESCRIPTION}\\n"
|
||||||
|
QF="$QF %{VENDOR} %{DISTRIBUTION} %{DISTURL}"
|
||||||
|
QF="$QF %{LICENSE} %{LICENSE}\\n"
|
||||||
|
QF="$QF %{GROUP} %{URL} %{EXCLUDEARCH} %{EXCLUDEOS} %{EXCLUSIVEARCH}\\n"
|
||||||
|
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*)
|
||||||
|
|
||||||
|
# XXX We don't look at triggers
|
||||||
|
|
||||||
|
QF="$QF [%{VERIFYSCRIPTPROG} %{VERIFYSCRIPT}]\\n"
|
||||||
|
|
||||||
|
# Only the first ChangeLog entry; should be enough
|
||||||
|
QF="$QF %{CHANGELOGTIME} %{CHANGELOGNAME} %{CHANGELOGTEXT}\\n"
|
||||||
|
|
||||||
|
file1=`mktemp`
|
||||||
|
file2=`mktemp`
|
||||||
|
|
||||||
|
check_header $oldrpm > $file1
|
||||||
|
check_header $newrpm > $file2
|
||||||
|
|
||||||
|
# the DISTURL tag can be used as checkin ID
|
||||||
|
#echo "$QF"
|
||||||
|
if ! diff -au $file1 $file2; then
|
||||||
|
rm $file1 $file2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
release1=`$RPM --qf "%{RELEASE}" "$oldrpm"`
|
||||||
|
release2=`$RPM --qf "%{RELEASE}" "$newrpm"`
|
||||||
|
|
||||||
|
check_provides $oldrpm $release1 > $file1
|
||||||
|
check_provides $newrpm $release2 > $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
|
||||||
|
# the size will influence the MD5 anyway. For directories the sizes can
|
||||||
|
# differ, depending on which file system the package was built. To not
|
||||||
|
# have to filter out directories we simply ignore all sizes.
|
||||||
|
# Also leave out FILEDEVICES, FILEINODES (depends on the build host),
|
||||||
|
# FILECOLORS, FILECLASS (???), FILEDEPENDSX and FILEDEPENDSN.
|
||||||
|
# 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
|
||||||
|
|
||||||
|
if ! diff -au $file1 $file2; then
|
||||||
|
rm $file1 $file2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
RES=2
|
||||||
|
# done if the same
|
||||||
|
if cmp -s $file1 $file2; then
|
||||||
|
RES=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get only files with different MD5sums
|
||||||
|
files=`diff -U0 $file1 $file2 | fgrep -v +++ | grep ^+ | cut -b2- | awk '{print $1}'`
|
||||||
|
|
||||||
|
rm $file1 $file2
|
||||||
|
return $RES
|
||||||
|
}
|
158
rpm-check.sh
158
rpm-check.sh
@ -6,7 +6,7 @@
|
|||||||
# Written by Michael Matz and Stephan Coolo
|
# Written by Michael Matz and Stephan Coolo
|
||||||
# Enhanced by Andreas Jaeger
|
# Enhanced by Andreas Jaeger
|
||||||
|
|
||||||
RPM="rpm -qp --nodigest --nosignature"
|
FUNCTIONS=${0%/*}/functions.sh
|
||||||
|
|
||||||
check_all=
|
check_all=
|
||||||
case $1 in
|
case $1 in
|
||||||
@ -20,6 +20,8 @@ if test "$#" != 2; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
source $FUNCTIONS
|
||||||
|
|
||||||
oldrpm=`readlink -f $1`
|
oldrpm=`readlink -f $1`
|
||||||
newrpm=`readlink -f $2`
|
newrpm=`readlink -f $2`
|
||||||
|
|
||||||
@ -33,18 +35,6 @@ if test ! -f $newrpm; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#usage unrpm <file>
|
|
||||||
# Unpack rpm files in current directory
|
|
||||||
# like /usr/bin/unrpm - just for one file and with no options
|
|
||||||
function unrpm()
|
|
||||||
{
|
|
||||||
local file
|
|
||||||
file=$1
|
|
||||||
CPIO_OPTS="--extract --unconditional --preserve-modification-time --make-directories --quiet"
|
|
||||||
|
|
||||||
rpm2cpio $file | cpio ${CPIO_OPTS}
|
|
||||||
}
|
|
||||||
|
|
||||||
#usage unjar <file>
|
#usage unjar <file>
|
||||||
function unjar()
|
function unjar()
|
||||||
{
|
{
|
||||||
@ -106,115 +96,30 @@ filter_disasm()
|
|||||||
sed -e 's/^ *[0-9a-f]\+://' -e 's/\$0x[0-9a-f]\+/$something/' -e 's/callq *[0-9a-f]\+/callq /' -e 's/# *[0-9a-f]\+/# /' -e 's/\(0x\)\?[0-9a-f]\+(/offset(/' -e 's/[0-9a-f]\+ </</' -e 's/^<\(.*\)>:/\1:/' -e 's/<\(.*\)+0x[0-9a-f]\+>/<\1 + ofs>/'
|
sed -e 's/^ *[0-9a-f]\+://' -e 's/\$0x[0-9a-f]\+/$something/' -e 's/callq *[0-9a-f]\+/callq /' -e 's/# *[0-9a-f]\+/# /' -e 's/\(0x\)\?[0-9a-f]\+(/offset(/' -e 's/[0-9a-f]\+ </</' -e 's/^<\(.*\)>:/\1:/' -e 's/<\(.*\)+0x[0-9a-f]\+>/<\1 + ofs>/'
|
||||||
}
|
}
|
||||||
|
|
||||||
QF="%{NAME}"
|
cmp_spec $1 $2
|
||||||
|
RES=$?
|
||||||
# don't look at RELEASE, it contains our build number
|
case $RES in
|
||||||
QF="$QF %{VERSION} %{EPOCH}\\n"
|
0)
|
||||||
QF="$QF %{SUMMARY}\\n%{DESCRIPTION}\\n"
|
exit 0
|
||||||
QF="$QF %{VENDOR} %{DISTRIBUTION} %{DISTURL}"
|
;;
|
||||||
QF="$QF %{LICENSE} %{LICENSE}\\n"
|
1)
|
||||||
QF="$QF %{GROUP} %{URL} %{EXCLUDEARCH} %{EXCLUDEOS} %{EXCLUSIVEARCH}\\n"
|
exit 1
|
||||||
QF="$QF %{EXCLUSIVEOS} %{RPMVERSION} %{PLATFORM}\\n"
|
;;
|
||||||
QF="$QF %{PAYLOADFORMAT} %{PAYLOADCOMPRESSOR} %{PAYLOADFLAGS}\\n"
|
2)
|
||||||
|
;;
|
||||||
QF="$QF [%{PREINPROG} %{PREIN}\\n]\\n[%{POSTINPROG} %{POSTIN}\\n]\\n[%{PREUNPROG} %{PREUN}\\n]\\n[%{POSTUNPROG} %{POSTUN}\\n]\\n"
|
*)
|
||||||
|
echo "Wrong exit code!"
|
||||||
# XXX We also need to check the existence (but not the content (!))
|
exit 1
|
||||||
# of SIGGPG (and perhaps the other SIG*)
|
;;
|
||||||
|
esac
|
||||||
# XXX We don't look at triggers
|
|
||||||
|
|
||||||
QF="$QF [%{VERIFYSCRIPTPROG} %{VERIFYSCRIPT}]\\n"
|
|
||||||
|
|
||||||
# Only the first ChangeLog entry; should be enough
|
|
||||||
QF="$QF %{CHANGELOGTIME} %{CHANGELOGNAME} %{CHANGELOGTEXT}\\n"
|
|
||||||
|
|
||||||
file1=`mktemp`
|
file1=`mktemp`
|
||||||
file2=`mktemp`
|
file2=`mktemp`
|
||||||
|
|
||||||
check_header()
|
|
||||||
{
|
|
||||||
$RPM --qf "$QF" "$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
check_header $oldrpm > $file1
|
|
||||||
check_header $newrpm > $file2
|
|
||||||
|
|
||||||
# the DISTURL tag can be used as checkin ID
|
|
||||||
#echo "$QF"
|
|
||||||
if ! diff -au $file1 $file2; then
|
|
||||||
rm $file1 $file2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
release1=`$RPM --qf "%{RELEASE}" "$oldrpm"`
|
|
||||||
release2=`$RPM --qf "%{RELEASE}" "$newrpm"`
|
|
||||||
|
|
||||||
check_provides()
|
|
||||||
{
|
|
||||||
|
|
||||||
# provides destroy this because at least the self-provide includes the
|
|
||||||
# -buildnumber :-(
|
|
||||||
QF="[%{PROVIDENAME} %{PROVIDEFLAGS} %{PROVIDEVERSION}\\n]\\n"
|
|
||||||
QF="$QF [%{REQUIRENAME} %{REQUIREFLAGS} %{REQUIREVERSION}\\n]\\n"
|
|
||||||
QF="$QF [%{CONFLICTNAME} %{CONFLICTFLAGS} %{CONFLICTVERSION}\\n]\\n"
|
|
||||||
QF="$QF [%{OBSOLETENAME} %{OBSOLETEFLAGS} %{OBSOLETEVERSION}\\n]\\n"
|
|
||||||
check_header "$1" | sed -e "s,-$2$,-@RELEASE@,"
|
|
||||||
}
|
|
||||||
|
|
||||||
check_provides $oldrpm $release1 > $file1
|
|
||||||
check_provides $newrpm $release2 > $file2
|
|
||||||
|
|
||||||
if ! diff -au $file1 $file2; then
|
|
||||||
rm $file1 $file2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# First check the file attributes and later the md5s
|
|
||||||
|
|
||||||
# Now the files. We leave out mtime and size. For normal files
|
|
||||||
# the size will influence the MD5 anyway. For directories the sizes can
|
|
||||||
# differ, depending on which file system the package was built. To not
|
|
||||||
# have to filter out directories we simply ignore all sizes.
|
|
||||||
# Also leave out FILEDEVICES, FILEINODES (depends on the build host),
|
|
||||||
# FILECOLORS, FILECLASS (???), FILEDEPENDSX and FILEDEPENDSN.
|
|
||||||
# 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
|
|
||||||
|
|
||||||
if ! diff -au $file1 $file2; then
|
|
||||||
rm $file1 $file2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
# done if the same
|
|
||||||
if cmp -s $file1 $file2; then
|
|
||||||
rm $file1 $file2
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
files=`diff -U0 $file1 $file2 | fgrep -v +++ | grep ^+ | cut -b2- | awk '{print $1}'`
|
|
||||||
|
|
||||||
dir=`mktemp -d`
|
dir=`mktemp -d`
|
||||||
|
unrpm $oldrpm $dir/old
|
||||||
|
unrpm $newrpm $dir/new
|
||||||
cd $dir
|
cd $dir
|
||||||
mkdir old
|
|
||||||
cd old
|
|
||||||
unrpm $oldrpm
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
mkdir new
|
|
||||||
cd new
|
|
||||||
unrpm $newrpm
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
dfile=`mktemp`
|
dfile=`mktemp`
|
||||||
|
|
||||||
@ -415,8 +320,12 @@ check_single_file()
|
|||||||
# .TH "OFFLINEIMAP" "1" "11 May 2010" "John Goerzen" "OfflineIMAP Manual"
|
# .TH "OFFLINEIMAP" "1" "11 May 2010" "John Goerzen" "OfflineIMAP Manual"
|
||||||
# .TH gv 3guile "13 May 2010"
|
# .TH gv 3guile "13 May 2010"
|
||||||
# .TH ARCH "1" "September 2010" "GNU coreutils 8.5" "User Commands"
|
# .TH ARCH "1" "September 2010" "GNU coreutils 8.5" "User Commands"
|
||||||
|
#.TH "GIT\-ARCHIMPORT" "1" "09/13/2010" "Git 1\&.7\&.1" "Git Manual"
|
||||||
for f in old/$file new/$file; do
|
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]* [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]\|[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]\|[0-1][0-9]/[0-9][0-9]/201[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
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
*.elc)
|
*.elc)
|
||||||
@ -462,7 +371,19 @@ check_single_file()
|
|||||||
sed -i -e 's%href="#\([a-z]*\.\)\?id[0-9]*">%href="#\1id0000000">%g' $f
|
sed -i -e 's%href="#\([a-z]*\.\)\?id[0-9]*">%href="#\1id0000000">%g' $f
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
|
*/created.rid)
|
||||||
|
# ruby documentation
|
||||||
|
# file just contains a timestamp and nothing else, so ignore it
|
||||||
|
echo "Ignore $file"
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
*/rdoc/files/*.html)
|
||||||
|
# ruby documentation
|
||||||
|
# <td>Mon Sep 20 19:02:43 +0000 2010</td>
|
||||||
|
for f in old/$file new/$file; do
|
||||||
|
sed -i -e 's%<td>[A-Z][a-z][a-z] [A-Z][a-z][a-z] [0-9]\+ [0-9]\+:[0-9]\+:[0-9]\+ +0000 201[0-9]</td>%<td>Mon Sep 20 19:02:43 +0000 2010</td>%g' $f
|
||||||
|
done
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
ftype=`/usr/bin/file old/$file | cut -d: -f2-`
|
ftype=`/usr/bin/file old/$file | cut -d: -f2-`
|
||||||
@ -558,4 +479,3 @@ fi
|
|||||||
rm $file1 $file2 $dfile
|
rm $file1 $file2 $dfile
|
||||||
rm -r $dir
|
rm -r $dir
|
||||||
exit $ret
|
exit $ret
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright (c) 2009 SUSE Linux Product Gmbh, Germany.
|
# Copyright (c) 2009, 2010 SUSE Linux Product Gmbh, Germany.
|
||||||
# Licensed under GPL v2, see COPYING file for details.
|
# Licensed under GPL v2, see COPYING file for details.
|
||||||
#
|
#
|
||||||
# Written by Adrian Schroeter <adrian@suse.de>
|
# Written by Adrian Schroeter <adrian@suse.de>
|
||||||
@ -11,6 +11,7 @@
|
|||||||
# /usr/lib/build/same-build-result.sh /.build.oldpackages /usr/src/packages/RPMS /usr/src/packages/SRPMS
|
# /usr/lib/build/same-build-result.sh /.build.oldpackages /usr/src/packages/RPMS /usr/src/packages/SRPMS
|
||||||
|
|
||||||
CMPSCRIPT=${0%/*}/rpm-check.sh
|
CMPSCRIPT=${0%/*}/rpm-check.sh
|
||||||
|
SCMPSCRIPT=${0%/*}/srpm-check.sh
|
||||||
|
|
||||||
OLDDIR="$1"
|
OLDDIR="$1"
|
||||||
shift
|
shift
|
||||||
@ -27,9 +28,9 @@ if [ -z "$NEWDIRS" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test `find $NEWDIRS -name *.rpm | wc -l` != `find $OLDDIR -name *.rpm | wc -l`; then
|
if test `find $NEWDIRS -name '*.rpm' -and ! -name '*.delta.rpm' | wc -l` != `find $OLDDIR -name '*.rpm' -and ! -name '*.delta.rpm' | wc -l`; then
|
||||||
echo "different number of subpackages"
|
echo "different number of subpackages"
|
||||||
find $OLDDIR $NEWDIRS -name *.rpm
|
find $OLDDIR $NEWDIRS -name '*.rpm' -and ! -name '*.delta.rpm'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -47,7 +48,7 @@ if test ! -f "$nsrpm"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "compare $osrpm $nsrpm"
|
echo "compare $osrpm $nsrpm"
|
||||||
bash $CMPSCRIPT "$osrpm" "$nsrpm" || exit 1
|
bash $SCMPSCRIPT "$osrpm" "$nsrpm" || exit 1
|
||||||
|
|
||||||
# technically we should not all exclude all -32bit but filter for different archs,
|
# technically we should not all exclude all -32bit but filter for different archs,
|
||||||
# like done with -x86
|
# like done with -x86
|
||||||
@ -56,8 +57,8 @@ bash $CMPSCRIPT "$osrpm" "$nsrpm" || exit 1
|
|||||||
# problem: a package can contain both noarch and arch subpackages, so we have to
|
# problem: a package can contain both noarch and arch subpackages, so we have to
|
||||||
# take care of proper sorting of NEWRPMS, e.g. noarch/x.rpm and x86_64/w.rpm since OLDRPMS
|
# take care of proper sorting of NEWRPMS, e.g. noarch/x.rpm and x86_64/w.rpm since OLDRPMS
|
||||||
# has all the packages in a single directory and would sort this as w.rpm, x.rpm.
|
# has all the packages in a single directory and would sort this as w.rpm, x.rpm.
|
||||||
OLDRPMS=($(find "$OLDDIR" -name \*rpm -a ! -name \*src.rpm|sort|grep -v -- -32bit-|grep -v -- -64bit-|grep -v -- '-x86-.*\.ia64\.rpm'))
|
OLDRPMS=($(find "$OLDDIR" -name \*rpm -a ! -name \*src.rpm -a ! -name \*.delta.rpm|sort|grep -v -- -32bit-|grep -v -- -64bit-|grep -v -- '-x86-.*\.ia64\.rpm'))
|
||||||
NEWRPMS=($(find $NEWDIRS -name \*rpm -a ! -name \*src.rpm|sort --field-separator=/ --key=7|grep -v -- -32bit-|grep -v -- -64bit-|grep -v -- '-x86-.*\.ia64\.rpm'))
|
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'))
|
||||||
|
|
||||||
rpmqp='rpm -qp --qf %{NAME} --nodigest --nosignature '
|
rpmqp='rpm -qp --qf %{NAME} --nodigest --nosignature '
|
||||||
for opac in ${OLDRPMS[*]}; do
|
for opac in ${OLDRPMS[*]}; do
|
||||||
@ -80,4 +81,3 @@ fi
|
|||||||
|
|
||||||
echo compare validated built as identical !
|
echo compare validated built as identical !
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
93
srpm-check.sh
Normal file
93
srpm-check.sh
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright (c) 2009, 2010 SUSE Linux Product GmbH, Germany.
|
||||||
|
# Licensed under GPL v2, see COPYING file for details.
|
||||||
|
#
|
||||||
|
# Written by Michael Matz and Stephan Coolo
|
||||||
|
# Enhanced by Andreas Jaeger
|
||||||
|
|
||||||
|
# Compare two source RPMs
|
||||||
|
|
||||||
|
FUNCTIONS=${0%/*}/functions.sh
|
||||||
|
|
||||||
|
check_all=
|
||||||
|
case $1 in
|
||||||
|
-a | --check-all)
|
||||||
|
check_all=1
|
||||||
|
shift
|
||||||
|
esac
|
||||||
|
|
||||||
|
if test "$#" != 2; then
|
||||||
|
echo "usage: $0 [-a|--check-all] old.rpm new.rpm"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
source $FUNCTIONS
|
||||||
|
|
||||||
|
oldrpm=`readlink -f $1`
|
||||||
|
newrpm=`readlink -f $2`
|
||||||
|
|
||||||
|
|
||||||
|
# For source RPMs, we can just check the metadata in the spec file
|
||||||
|
# if those are not the same, the source RPM has changed and therefore
|
||||||
|
# the resulting files are needed.
|
||||||
|
|
||||||
|
cmp_spec $1 $2
|
||||||
|
RES=$?
|
||||||
|
case $RES in
|
||||||
|
0)
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
1)
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Wrong exit code!"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Now check that only the spec file has a changed release number and
|
||||||
|
# nothing else
|
||||||
|
|
||||||
|
dir=`mktemp -d`
|
||||||
|
unrpm $oldrpm $dir/old
|
||||||
|
unrpm $newrpm $dir/new
|
||||||
|
cd $dir
|
||||||
|
|
||||||
|
check_single_file()
|
||||||
|
{
|
||||||
|
local file=$1
|
||||||
|
case $file in
|
||||||
|
*.spec)
|
||||||
|
sed -i -e "s,Release:.*$release1,Release: @RELEASE@," old/$file
|
||||||
|
sed -i -e "s,Release:.*$release2,Release: @RELEASE@," new/$file
|
||||||
|
if ! cmp -s old/$file new/$file; then
|
||||||
|
echo "$file differs (spec file)"
|
||||||
|
diff -u old/$file new/$file | head -n 200
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "$file differs"
|
||||||
|
# Nothing else should be changed
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
ret=0
|
||||||
|
for file in $files; do
|
||||||
|
if ! check_single_file $file; then
|
||||||
|
ret=1
|
||||||
|
if test -z "$check_all"; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
rm -r $dir
|
||||||
|
exit $ret
|
Loading…
Reference in New Issue
Block a user