- Make output more diffable and readable

- Fix unit tests

OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=280
This commit is contained in:
Olaf Hering 2020-07-27 15:54:58 +00:00 committed by Git OBS Bridge
parent 65e0daeec1
commit f505b94234
4 changed files with 13 additions and 5 deletions

View File

@ -1,7 +1,9 @@
-------------------------------------------------------------------
Mon Jul 27 06:06:06 UTC 2020 - bwiedemann@suse.de
- Make output more diffable and readable
- Fix regression in compare_archive
- Fix unit tests
-------------------------------------------------------------------
Fri May 29 19:20:21 UTC 2020 - olaf@aepfle.de

View File

@ -21,7 +21,7 @@ Summary: Build Result Compare Script
License: GPL-2.0+
Group: Development/Tools/Building
Url: https://github.com/openSUSE/build-compare
Version: 20200727T083615.6fb967d
Version: 20200727T175347.d95eb35
Release: 0
Source1: COPYING
Source2: same-build-result.sh

View File

@ -218,7 +218,7 @@ function unpackage()
function comp_file()
{
echo "comparing $1"
if ! diff -au $2 $3; then
if ! diff --label old-$1 --label new-$1 -au $2 $3; then
if test -z "$check_all"; then
rm $2 $3 $4 $5
return 1
@ -320,7 +320,7 @@ function cmp_rpm_meta ()
cat $rpm_meta_old | trim_release_old > $file1
cat $rpm_meta_new | trim_release_new > $file2
echo "comparing the rpm tags of $name_new"
if diff -au $file1 $file2; then
if diff --label old-rpm-tags --label new-rpm-tags -au $file1 $file2; then
rm $file1 $file2 $rpm_meta_old $rpm_meta_new
return 0
fi
@ -376,7 +376,7 @@ function cmp_rpm_meta ()
do
: "${REPLY}"
files+=( "${REPLY}" )
done < <(diff -U0 $file1 $file2 | sed -E -n -e '/^-\//{s/^-//;s/ [0-9a-f]+ [0-9]+$//;p}')
done < <(diff -U0 $file1 $file2 | sed -E -n -e '/^\+\//{s/^\+//;s/ [0-9a-f]+ [0-9]+$//;p}')
fi
if test -n "$sh"; then

View File

@ -198,6 +198,8 @@ diff_two_files()
offset=$(( ($offset >> 6) << 6 ))
length=512
diff -u \
--label "old $file (hex)" \
--label "new $file (hex)" \
<( hexdump -C -s $offset -n $length "old/$file" ) \
<( hexdump -C -s $offset -n $length "new/$file" ) | $buildcompare_head
return 1
@ -832,7 +834,7 @@ check_single_file()
verify_before_processing "${file}" "${dfile}"
case "$?" in
0) return 0 ;;
1) return 1 ;;
1) test -z "$check_all" && return 1 ;;
*) ;;
esac
@ -901,6 +903,8 @@ check_single_file()
ELF*[LM]SB\ pie\ executable*|\
setuid\ ELF*[LM]SB\ pie\ executable*)
diff --speed-large-files --unified \
--label "old $file (disasm)" \
--label "new $file (disasm)" \
<( $OBJDUMP -d --no-show-raw-insn old/$file |
filter_disasm |
sed -e "s,old/,," ;
@ -973,6 +977,8 @@ check_single_file()
for section in $sections
do
diff --unified \
--label "old $file (objdump)" \
--label "new $file (objdump)" \
<( $OBJDUMP -s -j $section old/$file |
sed -e "s,^old/,," ;
echo "${PIPESTATUS[@]}" > $file1) \