summaryrefslogtreecommitdiffstats
path: root/needs-checking/p_diff
diff options
context:
space:
mode:
authorMartin Quinson <mquinson@debian.org>2003-01-21 09:49:29 +0000
committerMartin Quinson <mquinson@debian.org>2003-01-21 09:49:29 +0000
commit02dc4a5f8c1979e9a23f7b6851f693d29b640c4d (patch)
tree2f397f5df89f4529b89fd0e7a021238d0f290007 /needs-checking/p_diff
parent4d11e99bfc25e0261111d202a3a2afdf97daea5c (diff)
downloadquilt-02dc4a5f8c1979e9a23f7b6851f693d29b640c4d.tar.gz
Version 0.11, from Andreas Gruenbacher
Diffstat (limited to 'needs-checking/p_diff')
-rwxr-xr-xneeds-checking/p_diff63
1 files changed, 63 insertions, 0 deletions
diff --git a/needs-checking/p_diff b/needs-checking/p_diff
new file mode 100755
index 0000000..1497b05
--- /dev/null
+++ b/needs-checking/p_diff
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+#
+# Bring up a patched file in diff. We show the diffs
+# in the topmost patch, unless it was specified
+#
+
+. patchfns 2>/dev/null ||
+. /usr/lib/patch-scripts/patchfns 2>/dev/null ||
+. $PATCHSCRIPTS_LIBDIR/patchfns 2>/dev/null ||
+{
+ echo "Impossible to find my library 'patchfns'."
+ echo "Check your install, or go to the right directory"
+ exit 1
+}
+
+usage()
+{
+ echo "Usage: pdiff [patchname] filename"
+ echo " pdiff [patchname] -"
+ exit 1
+}
+
+if [ $# == 1 ]
+then
+ PATCH_NAME=$(top_patch)
+ FILENAME=$1
+elif [ $# == 2 ]
+then
+ PATCH_NAME=$(stripit $1)
+ FILENAME=$2
+else
+ usage
+fi
+
+if ! is_applied $PATCH_NAME
+then
+ echo $PATCH_NAME is not applied
+ exit 1
+fi
+
+doit()
+{
+ filename=$1
+ unpatched_file=$filename"~"$PATCH_NAME
+ need_file_there $filename
+ if [ -e $unpatched_file ]
+ then
+ diff -u $unpatched_file $filename
+ else
+ echo pdiff: $filename appears to not be in $PATCH_NAME
+ fi
+}
+
+if [ x"$FILENAME" = "x-" ]
+then
+ FILENAME=$(cat $P/pc/$PATCH_NAME.pc)
+fi
+
+for i in $FILENAME
+do
+ doit $i
+done