forked from pool/build-compare
Accepting request 261535 from openSUSE:Tools
1 OBS-URL: https://build.opensuse.org/request/show/261535 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/build-compare?expand=0&rev=82
This commit is contained in:
commit
968123c720
@ -1,3 +1,20 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Nov 12 09:29:24 UTC 2014 - schwab@suse.de
|
||||||
|
|
||||||
|
- Use $(...) instead of `...` to avoid losing backslash quoting
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Nov 7 11:12:10 UTC 2014 - ohering@suse.de
|
||||||
|
|
||||||
|
- Update check-all option to really keep going and check all files
|
||||||
|
- Add check to recursively look into gzip files with odd suffix
|
||||||
|
to properly handle /usr/share/vlc/skins2/default.vlt
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Sat Aug 2 19:37:18 UTC 2014 - johannesobermayr@gmx.de
|
||||||
|
|
||||||
|
- Fix quoting .
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Jul 29 15:07:04 UTC 2014 - johannesobermayr@gmx.de
|
Tue Jul 29 15:07:04 UTC 2014 - johannesobermayr@gmx.de
|
||||||
|
|
||||||
|
32
functions.sh
32
functions.sh
@ -82,25 +82,31 @@ function cmp_spec ()
|
|||||||
# the DISTURL tag can be used as checkin ID
|
# the DISTURL tag can be used as checkin ID
|
||||||
#echo "$QF"
|
#echo "$QF"
|
||||||
if ! diff -au $file1 $file2; then
|
if ! diff -au $file1 $file2; then
|
||||||
rm $file1 $file2
|
if test -z "$check_all"; then
|
||||||
return 1
|
rm $file1 $file2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remember to quote the . which is in release
|
# Remember to quote the . which is in release
|
||||||
release1=`$RPM --qf "%{RELEASE}" "$oldrpm"|sed -e 's/\./\\./g'`
|
release1=$($RPM --qf "%{RELEASE}" "$oldrpm"|sed -e 's/\./\\./g')
|
||||||
release2=`$RPM --qf "%{RELEASE}" "$newrpm"|sed -e 's/\./\\./g'`
|
release2=$($RPM --qf "%{RELEASE}" "$newrpm"|sed -e 's/\./\\./g')
|
||||||
# This might happen with a forced rebuild of factory
|
# This might happen with a forced rebuild of factory
|
||||||
if [ "${release1%.*}" != "${release2%.*}" ] ; then
|
if [ "${release1%.*}" != "${release2%.*}" ] ; then
|
||||||
echo "release prefix mismatch"
|
echo "release prefix mismatch"
|
||||||
return 1
|
if test -z "$check_all"; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
check_provides $oldrpm $release1 > $file1
|
check_provides $oldrpm $release1 > $file1
|
||||||
check_provides $newrpm $release2 > $file2
|
check_provides $newrpm $release2 > $file2
|
||||||
|
|
||||||
if ! diff -au $file1 $file2; then
|
if ! diff -au $file1 $file2; then
|
||||||
rm $file1 $file2
|
if test -z "$check_all"; then
|
||||||
return 1
|
rm $file1 $file2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# scripts, might contain release number
|
# scripts, might contain release number
|
||||||
@ -109,8 +115,10 @@ function cmp_spec ()
|
|||||||
check_header $newrpm | sed -e "s,-$release2$,-@RELEASE@," > $file2
|
check_header $newrpm | sed -e "s,-$release2$,-@RELEASE@," > $file2
|
||||||
|
|
||||||
if ! diff -au $file1 $file2; then
|
if ! diff -au $file1 $file2; then
|
||||||
rm $file1 $file2
|
if test -z "$check_all"; then
|
||||||
return 1
|
rm $file1 $file2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# First check the file attributes and later the md5s
|
# First check the file attributes and later the md5s
|
||||||
@ -130,8 +138,10 @@ function cmp_spec ()
|
|||||||
check_header $newrpm | sed -e "s,-$release2,-@RELEASE@," > $file2
|
check_header $newrpm | sed -e "s,-$release2,-@RELEASE@," > $file2
|
||||||
|
|
||||||
if ! diff -au $file1 $file2; then
|
if ! diff -au $file1 $file2; then
|
||||||
rm $file1 $file2
|
if test -z "$check_all"; then
|
||||||
return 1
|
rm $file1 $file2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# now the md5sums. if they are different, we check more detailed
|
# now the md5sums. if they are different, we check more detailed
|
||||||
|
49
rpm-check.sh
49
rpm-check.sh
@ -104,7 +104,9 @@ case $RES in
|
|||||||
;;
|
;;
|
||||||
1)
|
1)
|
||||||
echo "RPM meta information is different"
|
echo "RPM meta information is different"
|
||||||
exit 1
|
if test -z "$check_all"; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
;;
|
;;
|
||||||
@ -150,6 +152,45 @@ strip_numbered_anchors()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
check_gzip_file()
|
||||||
|
{
|
||||||
|
local file=$1
|
||||||
|
local tmpdir=`mktemp -d`
|
||||||
|
local ftype
|
||||||
|
local ret=0
|
||||||
|
if test -n "$tmpdir"; then
|
||||||
|
mkdir $tmpdir/{old,new}
|
||||||
|
cp --parents --dereference old/$file $tmpdir/
|
||||||
|
cp --parents --dereference new/$file $tmpdir/
|
||||||
|
if pushd $tmpdir > /dev/null ; then
|
||||||
|
mv old/$file{,.gz}
|
||||||
|
mv new/$file{,.gz}
|
||||||
|
gunzip old/$file.gz
|
||||||
|
gunzip new/$file.gz
|
||||||
|
ftype=`/usr/bin/file old/$file | cut -d: -f2-`
|
||||||
|
case $ftype in
|
||||||
|
*POSIX\ tar\ archive)
|
||||||
|
echo "gzip content is: $ftype"
|
||||||
|
mv old/$file{,.tar}
|
||||||
|
mv new/$file{,.tar}
|
||||||
|
if ! check_single_file ${file}.tar; then
|
||||||
|
ret=1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "unhandled gzip content: $ftype"
|
||||||
|
if ! diff_two_files; then
|
||||||
|
ret=1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
popd > /dev/null
|
||||||
|
fi
|
||||||
|
rm -rf "$tmpdir"
|
||||||
|
fi
|
||||||
|
return $ret
|
||||||
|
}
|
||||||
|
|
||||||
check_single_file()
|
check_single_file()
|
||||||
{
|
{
|
||||||
local file="$1"
|
local file="$1"
|
||||||
@ -513,6 +554,12 @@ check_single_file()
|
|||||||
# tar might package directories - ignore them here
|
# tar might package directories - ignore them here
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
|
*gzip\ compressed\ data*)
|
||||||
|
echo "gzipped file with odd filename: $file"
|
||||||
|
if ! check_gzip_file "$file"; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
if ! diff_two_files; then
|
if ! diff_two_files; then
|
||||||
return 1
|
return 1
|
||||||
|
@ -64,8 +64,8 @@ NEWRPMS=($(find $NEWDIRS -type f -name \*rpm -a ! -name \*src.rpm -a ! -name \*.
|
|||||||
|
|
||||||
# Get release from first RPM and keep for rpmlint check
|
# Get release from first RPM and keep for rpmlint check
|
||||||
# Remember to quote the "." for future regexes
|
# Remember to quote the "." for future regexes
|
||||||
release1=`rpm -qp --nodigest --nosignature --qf "%{RELEASE}" "${OLDRPMS[0]}"|sed -e 's/\./\\./g'`
|
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'`
|
release2=$(rpm -qp --nodigest --nosignature --qf "%{RELEASE}" "${NEWRPMS[0]}"|sed -e 's/\./\\./g')
|
||||||
|
|
||||||
SUCCESS=1
|
SUCCESS=1
|
||||||
rpmqp='rpm -qp --qf %{NAME} --nodigest --nosignature '
|
rpmqp='rpm -qp --qf %{NAME} --nodigest --nosignature '
|
||||||
|
Loading…
x
Reference in New Issue
Block a user