diff --git a/build-compare.changes b/build-compare.changes index 01e7709..aeae8a7 100644 --- a/build-compare.changes +++ b/build-compare.changes @@ -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 diff --git a/build-compare.spec b/build-compare.spec index e67b1a5..18487e9 100644 --- a/build-compare.spec +++ b/build-compare.spec @@ -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 diff --git a/functions.sh b/functions.sh index 3dd8134..a0d228e 100644 --- a/functions.sh +++ b/functions.sh @@ -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 diff --git a/pkg-diff.sh b/pkg-diff.sh index 0cf0d34..b7f125a 100644 --- a/pkg-diff.sh +++ b/pkg-diff.sh @@ -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) \