[Reproducible-commits] [misc] 03/03: Drop diffp now that we have debbindiff

Chris Lamb lamby at moszumanska.debian.org
Thu Jul 9 14:14:29 UTC 2015


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository misc.

commit a47602f9ea95f4a85991705d4d0e771855a321d3
Author: Chris Lamb <lamby at debian.org>
Date:   Thu Jul 9 15:11:47 2015 +0100

    Drop diffp now that we have debbindiff
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 README |  13 -------
 diffp  | 127 -----------------------------------------------------------------
 2 files changed, 140 deletions(-)

diff --git a/README b/README
index 95b5efa..9b23932 100644
--- a/README
+++ b/README
@@ -4,19 +4,6 @@ Misc. collection of scripts for reproducible builds in Debian
 See <https://wiki.debian.org/ReproducibleBuilds> to know more about the
 project.
 
-diffp: compare two package builds
----------------------------------
-
-`diffp` was written to be able to quickly spot and investigate differences
-between the binary packages produced by two different builds.
-
-Usage:
-
-    diffp r1/hello_2.8-4_amd64.changes r2/hello_2.8-4_amd64
-
-The current output is pretty crude — a collection of diff outputs — but it has
-proven really helpful so far.
-
 clean-notes: sort and cleanup the packages' notes
 -------------------------------------------------
 
diff --git a/diffp b/diffp
deleted file mode 100755
index d07ec57..0000000
--- a/diffp
+++ /dev/null
@@ -1,127 +0,0 @@
-#!/bin/bash
-# diffp: compare two package builds
-# Copyright © 2013 Lunar <lunar at debian.org>
-# Licensed under WTFPL — http://www.wtfpl.net/txt/copying/
-#
-# Depends: bash, binutils, unzip, python-hachoir-metadata, ghc
-
-CHANGES_A="$1"
-CHANGES_B="$2"
-
-trim_diff() {
-	grep -Ev '^(@@ |--- |\+\+\+ )'
-}
-
-get_ops() {
-	local file="$1"
-
-	case "$file" in
-	    */bin/*|*/sbin/*)
-		case "$(ar p $PACKAGE_A $DATA_TAR | $DATA_COMPR | tar -xOf - $file | file -)" in
-		    *ELF*)
-			echo "readelf -a FILE"
-			echo "readelf -w FILE"
-			echo "objdump -d FILE"
-			;;
-		esac
-		;;
-	    *.so|*.so.[0-9]*)
-		echo "readelf -a FILE"
-		echo "readelf -w FILE"
-		echo "objdump -d FILE"
-		;;
-	    *.a)
-		echo "ar tv FILE"
-		;;
-	    *.zip|*.jar)
-		echo "unzip -lv FILE"
-		;;
-	    *.gz)
-		echo "file FILE"
-		echo "zcat FILE"
-		;;
-	    *.hi|*.p_hi)
-		echo "ghc --show-iface FILE"
-		;;
-	    *.mo)
-		echo "msgunfmt FILE"
-	esac
-}
-
-diffc() {
-	local diff
-
-	diff="$(diff -u0 <(echo "$@" | sed -e "s,PACKAGE,$PACKAGE_A," | bash) \
-	         <(echo "$@" | sed -e "s,PACKAGE,$PACKAGE_B," | bash))"
-	[ "$diff" ] || return 0
-	echo "$diff" | trim_diff
-	return 1
-}
-
-paste <(dcmd "$CHANGES_A" | sort | grep '\.deb$') <(dcmd "$CHANGES_B" | sort | grep '\.deb$') | while read PACKAGE_A PACKAGE_B; do
-	PACKAGE="$(basename "$PACKAGE_A")"
-	if [ "$PACKAGE" != "$(basename "$PACKAGE_B")" ]; then
-		echo "$PACKAGE_A and $PACKAGE_B does not match. Something is wrong."
-		exit 1
-	fi
-	echo "***** $PACKAGE"
-
-	diffc "sha1sum < PACKAGE | sed -e 's,-$,$PACKAGE,'" && continue
-
-	DATA_TAR=
-	for file in data.tar.gz data.tar.bz2 data.tar.xz; do
-		if [ "$file" = "$(ar t "$PACKAGE_A" "$file" 2>/dev/null)" ]; then
-			DATA_TAR="$file"
-			case "$file" in *.gz) DATA_COMPR="zcat" ;;
-					*.bz2) DATA_COMPR="bzcat" ;;
-					*.xz) DATA_COMPR="xzcat" ;;
-			esac
-		fi
-	done
-	if [ -z "$DATA_TAR" ]; then
-		echo "Unable to find data.tar in $PACKAGE"
-		continue
-	fi
-
-	MISMATCH=
-	for file in debian-binary control.tar.gz "$DATA_TAR"; do
-		if diffc "ar p PACKAGE $file | sha1sum | sed -e s/-$/$file/"; then
-			MISMATCH=1
-		fi
-	done
-	[ "$MISMATCH" ] || continue
-
-	echo "===== control.tar.gz"
-
-	diffc 'hachoir-metadata --raw --quality=1 --maxlen=0 <(ar p PACKAGE control.tar.gz | zcat)'
-	ar p $PACKAGE_A control.tar.gz | tar -zvtf - | grep '^-' | while read flags user size date time file; do
-		echo "----- $file"
-		diffc "ar p PACKAGE control.tar.gz | tar -zxOf - $file"
-	done
-
-	echo "===== $DATA_TAR"
-	diffc "hachoir-metadata --raw --quality=1 --maxlen=0 <(ar p PACKAGE $DATA_TAR | $DATA_COMPR)"
-	if ar p "$PACKAGE_A" control.tar.gz | tar -ztf - ./md5sums >/dev/null; then
-		FILES="$(diffc "ar p PACKAGE control.tar.gz | tar -zxOf - ./md5sums" | awk '/^-/ { print "./" $2 }')"
-	else
-		FILES="$(ar p $PACKAGE_A $DATA_TAR | $DATA_COMPR | tar -vtf - | awk '/^-/ { print $6 }')"
-	fi
-	echo "$FILES" | while read file; do
-		echo "----- $file"
-		diffc "ar p PACKAGE $DATA_TAR | $DATA_COMPR | tar -xOf - $file" |
-		    sed -e "s,Binary files [^ ]* and [^ ]* differ,Binary file $file differ,"
-
-		OPS="$(get_ops "$file")"
-		[ "$OPS" ] || continue
-
-		TMP_A=$(mktemp)
-		TMP_B=$(mktemp)
-		ar p $PACKAGE_A $DATA_TAR | $DATA_COMPR | tar -xOf - $file > "$TMP_A"
-		ar p $PACKAGE_B $DATA_TAR | $DATA_COMPR | tar -xOf - $file > "$TMP_B"
-		echo "$OPS" | while read op; do
-			diff -u0 <(echo "$op" | sed -e "s,FILE,$TMP_A," | sh | sed -e "s,$TMP_A,$file,g") \
-			         <(echo "$op" | sed -e "s,FILE,$TMP_B," | sh | sed -e "s,$TMP_B,$file,g") | trim_diff
-		done
-		rm -f "$TMP_A" "$TMP_B"
-	done
-done

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/misc.git



More information about the Reproducible-commits mailing list