summaryrefslogtreecommitdiff
path: root/pkgtools/pkgdiff
diff options
context:
space:
mode:
authoratatat <atatat@pkgsrc.org>2003-06-14 19:12:40 +0000
committeratatat <atatat@pkgsrc.org>2003-06-14 19:12:40 +0000
commitaf2afefc251efb4324c00c310db4dedc99033d21 (patch)
tree5e8c8827ce6cd4a5febc547d44480f12f310273d /pkgtools/pkgdiff
parente239c6dd3a073a1d8c32459cba7693d002a0d23d (diff)
downloadpkgsrc-af2afefc251efb4324c00c310db4dedc99033d21.tar.gz
Add support to pkgdiff for the environment variable PKGDIFF_FMT. This
allows you to get context style or plain diffs from mkpatches or pkgdiff, instead of the default unified format. Sometimes it's very nice to be able to look at a different diff format.
Diffstat (limited to 'pkgtools/pkgdiff')
-rw-r--r--pkgtools/pkgdiff/Makefile4
-rwxr-xr-xpkgtools/pkgdiff/files/pkgdiff9
-rw-r--r--pkgtools/pkgdiff/files/pkgdiff.117
3 files changed, 22 insertions, 8 deletions
diff --git a/pkgtools/pkgdiff/Makefile b/pkgtools/pkgdiff/Makefile
index 6b3d39581fb..0253c03c734 100644
--- a/pkgtools/pkgdiff/Makefile
+++ b/pkgtools/pkgdiff/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.35 2003/06/10 12:47:32 wiz Exp $
+# $NetBSD: Makefile,v 1.36 2003/06/14 19:12:40 atatat Exp $
#
-DISTNAME= pkgdiff-0.110
+DISTNAME= pkgdiff-0.111
WRKSRC= ${WRKDIR}
CATEGORIES= pkgtools devel
MASTER_SITES= # empty
diff --git a/pkgtools/pkgdiff/files/pkgdiff b/pkgtools/pkgdiff/files/pkgdiff
index 75e59fcb6bd..040fc3e02b8 100755
--- a/pkgtools/pkgdiff/files/pkgdiff
+++ b/pkgtools/pkgdiff/files/pkgdiff
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: pkgdiff,v 1.11 2003/06/10 12:47:32 wiz Exp $
+# $NetBSD: pkgdiff,v 1.12 2003/06/14 19:12:41 atatat Exp $
#
# Usage: pkgdiff newfile
# pkgdiff oldfile newfile
@@ -38,7 +38,8 @@ dodiff() {
}
lines=3
-while [ `dodiff -u -p -$lines "$old" "$new" | egrep -c '\\$(NetBSD|Author|Date|Header|Id|Locker|Log|Name|RCSfile|Revision|Source|State)(:.*)?\\$'` != 0 ]
+: ${PKGDIFF_FMT:=-u -p}
+while [ `dodiff "$PKGDIFF_FMT" -$lines "$old" "$new" | egrep -c '\\$(NetBSD|Author|Date|Header|Id|Locker|Log|Name|RCSfile|Revision|Source|State)(:.*)?\\$'` != 0 ]
do
lines=`expr $lines - 1`
if [ $lines = 0 ]; then
@@ -47,7 +48,7 @@ do
fi
done
-if dodiff -q -u -p -$lines "$old" "$new" > /dev/null
+if dodiff -q "$PKGDIFF_FMT" -$lines "$old" "$new" > /dev/null
then
:
else
@@ -55,5 +56,5 @@ else
echo ''
# Strip out the date on the +++ line to reduce needless
# differences in regenerated patches
- dodiff -u -p -$lines "$old" "$new" | sed -e 's:^\(+++ [^ ]*\) .*:\1:'
+ dodiff "$PKGDIFF_FMT" -$lines "$old" "$new" | sed -e 's:^\(+++ [^ ]*\) .*:\1:'
fi
diff --git a/pkgtools/pkgdiff/files/pkgdiff.1 b/pkgtools/pkgdiff/files/pkgdiff.1
index f4435816a5f..755dcac94bc 100644
--- a/pkgtools/pkgdiff/files/pkgdiff.1
+++ b/pkgtools/pkgdiff/files/pkgdiff.1
@@ -1,9 +1,9 @@
-.\" $NetBSD: pkgdiff.1,v 1.3 2001/12/03 19:03:22 wiz Exp $
+.\" $NetBSD: pkgdiff.1,v 1.4 2003/06/14 19:12:41 atatat Exp $
.\"
.\" Copyright (c) 2000 by Hubert Feyrer <hubertf@netbsd.org>
.\" All Rights Reserved. Absolutely no warranty.
.\"
-.Dd May 14, 2000
+.Dd Jun 14, 2003
.Dt PKGDIFF 1
.Os
.Sh NAME
@@ -29,6 +29,19 @@ not include any RCS IDs.
.Ar options
can be any options that are allowed for
.Xr diff 1 .
+.Sh ENVIRONMENT
+.Ss PKGDIFF_FMT
+The flags passed to
+.Xr diff 1
+when generating patches.
+If not set, the flags
+.Fl u
+and
+.Fl p
+are used.
+Though only unified format patches are used in pkgsrc as proper
+patches, sometimes it can be useful to have context or plain diffs
+available.
.Sh SEE ALSO
.Xr cvs 1 ,
.Xr diff 1 ,