aboutsummaryrefslogtreecommitdiff
path: root/slackpkgdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2020-06-10 19:42:04 -0400
committerB. Watson <yalhcru@gmail.com>2020-06-10 19:42:04 -0400
commitc3238e690a1f3254d282623e047f0124206de9b9 (patch)
treeaad4069d37a258d2d641fef67abd7a3317fde111 /slackpkgdiff
parentfdab64c728d172419b3cc3f8a566a3fd134ab366 (diff)
downloadsbostuff-c3238e690a1f3254d282623e047f0124206de9b9.tar.gz
cleanup, wip for eventual release
Diffstat (limited to 'slackpkgdiff')
-rwxr-xr-xslackpkgdiff29
1 files changed, 29 insertions, 0 deletions
diff --git a/slackpkgdiff b/slackpkgdiff
new file mode 100755
index 0000000..d6aca04
--- /dev/null
+++ b/slackpkgdiff
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# compare filenames in 2 tarballs, except /usr/doc/blah-<version> dirs
+# get treated specially.
+
+if [ "$1" = "--help" ]; then
+ cat <<EOF
+slackpkgdiff - compare contents of 2 Slackware packages without installing them
+Usage: slackpkgdiff pkg1 pkg2
+EOF
+fi
+
+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.$$
+mkdir -p $DIR || exit 1
+list_tar "$1"
+list_tar "$2"
+diff $DIR/$( pkg_name "$1" ) $DIR/$( pkg_name "$2" )
+ret="$?"
+rm -rf $DIR
+return "$ret"