[devscripts] 01/02: Revert "debrepro: Compare .changes files and fallback to use debdiff"
Antonio Terceiro
terceiro at moszumanska.debian.org
Tue Nov 8 11:51:15 UTC 2016
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to branch master
in repository devscripts.
commit 76972f6ea97c71580d76e5e01c879deb624a2e47
Author: Antonio Terceiro <terceiro at debian.org>
Date: Tue Nov 8 09:44:46 2016 -0200
Revert "debrepro: Compare .changes files and fallback to use debdiff"
debdiff does *NOT* compare the contents of binary packages, only their
file lists.
This reverts commit 0be42ea6fd466f492fbc317f186a39231eb4947a.
---
scripts/debrepro.sh | 35 ++++++++++++++++++++---------------
1 file changed, 20 insertions(+), 15 deletions(-)
diff --git a/scripts/debrepro.sh b/scripts/debrepro.sh
index c8a38e1..71bbcea 100755
--- a/scripts/debrepro.sh
+++ b/scripts/debrepro.sh
@@ -3,7 +3,6 @@
# debrepro: a reproducibility tester for Debian packages
#
# © 2016 Antonio Terceiro <terceiro at debian.org>
-# Copyright © 2016 Guillem Jover <guillem at debian.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -101,22 +100,28 @@ build() {
mv "$tmpdir/build" "$tmpdir/$which_build"
}
+binmatch() {
+ cmp --silent "$1" "$2"
+}
+
compare() {
rc=0
- first_changes=$(echo "$tmpdir"/first/*.changes)
- changes="$(basename "$first_changes")"
- second_changes="$tmpdir/second/$changes"
-
- if which diffoscope >/dev/null; then
- diffoscope "$first_changes" "$second_changes" || rc=1
- else
- debdiff -q -d --control --controlfiles ALL \
- "$first_changes" "$second_changes" || rc=1
- fi
- if [ "$rc" -eq 0 ]; then
- echo "✓ $changes: artifacts match"
- else
- echo "✗ $changes: artifacts do not match"
+ for first_deb in "$tmpdir"/first/*.deb; do
+ deb="$(basename "$first_deb")"
+ second_deb="$tmpdir"/second/"$deb"
+ if binmatch "$first_deb" "$second_deb"; then
+ echo "✓ $deb: binaries match"
+ else
+ echo ""
+ rc=1
+ if which diffoscope >/dev/null; then
+ diffoscope "$first_deb" "$second_deb" || true
+ else
+ echo "✗ $deb: binaries don't match"
+ fi
+ fi
+ done
+ if [ "$rc" -ne 0 ]; then
echo "E: package is not reproducible."
if ! which diffoscope >/dev/null; then
echo "I: install diffoscope for a deeper comparison between binaries"
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git
More information about the devscripts-devel
mailing list