From 40f986daaaf99b56d0ef06f5fe6d5a03f73108b3 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sat, 18 Mar 2017 15:08:41 -0400 Subject: add pkgdiff --- pkgdiff | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 pkgdiff (limited to 'pkgdiff') diff --git a/pkgdiff b/pkgdiff new file mode 100755 index 0000000..837c70b --- /dev/null +++ b/pkgdiff @@ -0,0 +1,21 @@ +#!/bin/bash + +# compare filenames in 2 tarballs, except /usr/doc/blah- dirs +# get treated specially. + +pkg_name() { + echo "$1" | sed 's,.*/,,' | sed 's,\.[^.]*$,,' +} + +list_tar() { + pkg="$( echo $1 | sed 's,\.[^.]*,,' )" + tar tf "$1" | sed 's,usr/doc/[^/]*/,usr/doc/@DOCDIR@/,' | sort > $DIR/$( pkg_name "$1" ) +} + +DIR=/tmp/pkgdiff.$RANDOM.$$ +echo $DIR +mkdir -p $DIR || exit 1 +list_tar "$1" +list_tar "$2" +diff $DIR/$( pkg_name "$1" ) $DIR/$( pkg_name "$2" ) +rm -rf $DIR -- cgit v1.2.3