Permalink
Browse files

rpg-diff shows diff between two package versions (WIP)

  • Loading branch information...
1 parent d9b6758 commit ec9536effb803f9efff4cbf4cc3e3da70069fcf2 @rtomayko committed Mar 22, 2010
Showing with 25 additions and 1 deletion.
  1. +3 −0 .gitignore
  2. +1 −1 Makefile
  3. +21 −0 rpg-diff.sh
View
@@ -61,3 +61,6 @@ strnatcmp.o
rpg-solve-fast.o
rpg-solve-fast
rpg-leaves
+rpg-diff
+rpg-manifest
+*.o
View
@@ -28,7 +28,7 @@ PROGRAMPROGRAMS = \
rpg-outdated rpg-package-list rpg-package-register rpg-package-install \
rpg-unpack rpg-package-spec rpg-parse-index rpg-shit-list \
rpg-prepare rpg-complete rpg-help rpg-package-index rpg-dependencies \
- rpg-leaves rpg-manifest rpg-solve
+ rpg-leaves rpg-manifest rpg-solve rpg-diff
DEADPROGRAMS = \
rpg-update rpg-status rpg-parse-package-list rpg-version-test
View
@@ -0,0 +1,21 @@
+#!/bin/sh
+set -e
+. rpg-sh-setup
+
+[ "$*" ] || set -- --help; ARGV="$@"
+USAGE '${PROGNAME} <package>
+ ${PROGNAME} <package> <version>
+ ${PROGNAME} <package> <ver1> <ver2>
+Show diff between package versions. With no <version>, show diff between
+most recent available version and installed version. With one <version>, show diff
+between currently installed version and <version>. With <ver1> and <ver2>, show
+diff between <ver1> and <ver2>.'
+
+package="$1"
+ver1="$2"
+ver2="$3"
+
+dir1=$(rpg-unpack -nP "$package" "$ver1")
+dir2=$(rpg-unpack -nP "$package" "$ver2")
+
+diff -ruN "$dir1" "$dir2"

0 comments on commit ec9536e

Please sign in to comment.