forked from pool/build-compare
This commit is contained in:
parent
d7e70f80b2
commit
99abc9ebe9
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 14 11:46:04 CEST 2009 - coolo@novell.com
|
||||
|
||||
- support .jar and .zip files
|
||||
- fix support of gzipped files
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon May 4 15:19:04 CEST 2009 - coolo@suse.de
|
||||
|
||||
|
@ -24,7 +24,7 @@ Group: Development/Tools/Building
|
||||
AutoReqProv: on
|
||||
Summary: Build Result Compare Script
|
||||
Version: 2009.01.27
|
||||
Release: 8
|
||||
Release: 9
|
||||
Source: same-build-result.sh
|
||||
Source1: rpm-check.sh
|
||||
Source2: COPYING
|
||||
@ -54,33 +54,3 @@ install -m 0644 %SOURCE2 $RPM_BUILD_ROOT/%_defaultdocdir/%name/
|
||||
/usr/lib/build
|
||||
|
||||
%changelog
|
||||
* Mon May 04 2009 coolo@suse.de
|
||||
- compare content of *.tar too
|
||||
* Mon May 04 2009 coolo@suse.de
|
||||
- if objdump fails, fall back to hexdump (bnc#489965)
|
||||
* Mon May 04 2009 coolo@suse.de
|
||||
- ignore dates in mo files (bnc#489198)
|
||||
* Tue Apr 28 2009 mmarek@suse.cz
|
||||
- rpm-check.sh: add option --check-all to check all packaged files
|
||||
(useful for debugging)
|
||||
* Sun Feb 08 2009 coolo@suse.de
|
||||
- fix handling of hardlinks to compressed files
|
||||
* Sat Feb 07 2009 coolo@suse.de
|
||||
- fix handling of -32bit and -64bit
|
||||
* Sat Feb 07 2009 coolo@suse.de
|
||||
- fix command line order
|
||||
* Fri Feb 06 2009 coolo@suse.de
|
||||
- use --no-show-raw-insn for objdump -d
|
||||
* Fri Feb 06 2009 coolo@suse.de
|
||||
- hopefully fixed shell quoting for rpm command line
|
||||
* Thu Feb 05 2009 coolo@suse.de
|
||||
- fix 2 bugs
|
||||
- don't ignore source rpms - changed sources should output
|
||||
changed source rpms, no matter if they create the same binaries
|
||||
(think of changed copyright header in spec files)
|
||||
* Tue Jan 27 2009 adrian@suse.de
|
||||
- Create initial package based on the work of Matz and Coolo
|
||||
This package provides script for the main build script to be able
|
||||
to check if a new build has the same result than the former one.
|
||||
The Build Service is able to skip the new build than.
|
||||
- changes in source rpms are currently ignored, is that okay ?
|
||||
|
47
rpm-check.sh
47
rpm-check.sh
@ -184,9 +184,11 @@ check_single_file()
|
||||
ar x `basename $file`
|
||||
cd $pwd
|
||||
for f in $flist; do
|
||||
check_single_file $fdir/$f
|
||||
if ! check_single_file $fdir/$f; then
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
continue;;
|
||||
;;
|
||||
*.tar|*.tar.bz2|*.tar.gz|*.tgz|*.tbz2)
|
||||
flist=`tar tf new/$file`
|
||||
pwd=$PWD
|
||||
@ -206,6 +208,37 @@ check_single_file()
|
||||
fi
|
||||
done
|
||||
return $ret;;
|
||||
*.zip|*.jar)
|
||||
cd old
|
||||
unzip -l ./$file > flist
|
||||
sed -i -e "s, [0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] , date ," flist
|
||||
cd ../new
|
||||
unzip -l ./$file > flist
|
||||
sed -i -e "s, [0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] , date ,; " flist
|
||||
cd ..
|
||||
if ! cmp -s old/flist new/flist; then
|
||||
echo "$file has different file list"
|
||||
diff -u old/flist new/flist
|
||||
return 1
|
||||
fi
|
||||
flist=`grep date new/flist | sed -e 's,.* date ,,'`
|
||||
pwd=$PWD
|
||||
fdir=`dirname $file`
|
||||
cd old/$fdir
|
||||
unzip -qq `basename $file`
|
||||
cd $pwd/new/$fdir
|
||||
unzip -qq `basename $file`
|
||||
cd $pwd
|
||||
local ret=0
|
||||
for f in $flist; do
|
||||
if test -f new/$fdir/$f && ! check_single_file $fdir/$f; then
|
||||
ret=1
|
||||
if test -z "$check_all"; then
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
return $ret;;
|
||||
*.pyc|*.pyo)
|
||||
perl -E "open fh, '+<', 'old/$file'; seek fh, 3, SEEK_SET; print fh '0000';"
|
||||
perl -E "open fh, '+<', 'new/$file'; seek fh, 3, SEEK_SET; print fh '0000';"
|
||||
@ -214,12 +247,14 @@ check_single_file()
|
||||
bunzip2 -c old/$file > old/${file/.bz2/}
|
||||
bunzip2 -c new/$file > new/${file/.bz2/}
|
||||
check_single_file ${file/.bz2/}
|
||||
return;;
|
||||
return $?
|
||||
;;
|
||||
*.gz)
|
||||
gunzip -c old/$file > old/${file/.gz/}
|
||||
gunzip -c new/$file > new/${file/.gz/}
|
||||
check_single_file ${file/.gz/}
|
||||
return;;
|
||||
return $?
|
||||
;;
|
||||
/usr/share/locale/*/LC_MESSAGES/*.mo|/usr/share/locale-bundle/*/LC_MESSAGES/*.mo)
|
||||
sed -i -e "s,POT-Creation-Date: ....-..-.. ..:..+....,POT-Creation-Date: 1970-01-01 00:00+0000," old/$file
|
||||
sed -i -e "s,POT-Creation-Date: ....-..-.. ..:..+....,POT-Creation-Date: 1970-01-01 00:00+0000," new/$file
|
||||
@ -232,7 +267,7 @@ check_single_file()
|
||||
objdump -d --no-show-raw-insn old/$file | filter_disasm > $file1
|
||||
if ! test -s $file1; then
|
||||
# objdump has no idea how to handle it
|
||||
if diff_two_files; then
|
||||
if ! diff_two_files; then
|
||||
ret=1
|
||||
break
|
||||
fi
|
||||
@ -265,7 +300,7 @@ check_single_file()
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
if diff_two_files; then
|
||||
if ! diff_two_files; then
|
||||
return 1
|
||||
fi
|
||||
;;
|
||||
|
Loading…
x
Reference in New Issue
Block a user