diff options
author | B. Watson <yalhcru@gmail.com> | 2017-03-18 15:08:41 -0400 |
---|---|---|
committer | B. Watson <yalhcru@gmail.com> | 2017-03-18 15:08:41 -0400 |
commit | 40f986daaaf99b56d0ef06f5fe6d5a03f73108b3 (patch) | |
tree | c60772188d46c6e9e82a93b3590d6b1fee367e76 | |
parent | 834e26a3a54e394a42906216536d733f065e6aaf (diff) | |
download | sbostuff-40f986daaaf99b56d0ef06f5fe6d5a03f73108b3.tar.gz |
add pkgdiff
-rwxr-xr-x | pkgdiff | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -0,0 +1,21 @@ +#!/bin/bash + +# compare filenames in 2 tarballs, except /usr/doc/blah-<version> 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 |