summaryrefslogtreecommitdiff
path: root/pkgtools/pkgdiff
diff options
context:
space:
mode:
authordholland <dholland>2012-09-16 18:09:53 +0000
committerdholland <dholland>2012-09-16 18:09:53 +0000
commit8728da0e3ad2a3e7b7c4524a4bb2cce72797e01b (patch)
tree17d37c84f1bc3b7c7c7c15ae55eea84b5e8a6709 /pkgtools/pkgdiff
parent75a0d7ab317618415a05110b6ff0f476c8d9ef7d (diff)
downloadpkgsrc-8728da0e3ad2a3e7b7c4524a4bb2cce72797e01b.tar.gz
Drop back to diff without -p before giving up because of rcsids appearing
in the diff output. Also, improve the error message that occurs if this also fails. Fixes PR 46962.
Diffstat (limited to 'pkgtools/pkgdiff')
-rw-r--r--pkgtools/pkgdiff/Makefile4
-rwxr-xr-xpkgtools/pkgdiff/files/pkgdiff19
2 files changed, 19 insertions, 4 deletions
diff --git a/pkgtools/pkgdiff/Makefile b/pkgtools/pkgdiff/Makefile
index 0f1923c90cd..74e96643fcf 100644
--- a/pkgtools/pkgdiff/Makefile
+++ b/pkgtools/pkgdiff/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.77 2012/09/11 23:19:38 asau Exp $
+# $NetBSD: Makefile,v 1.78 2012/09/16 18:09:53 dholland Exp $
#
-DISTNAME= pkgdiff-1.3
+DISTNAME= pkgdiff-1.4
CATEGORIES= pkgtools devel
MASTER_SITES= # empty
DISTFILES= # empty
diff --git a/pkgtools/pkgdiff/files/pkgdiff b/pkgtools/pkgdiff/files/pkgdiff
index 09d28a9204e..846fa749a75 100755
--- a/pkgtools/pkgdiff/files/pkgdiff
+++ b/pkgtools/pkgdiff/files/pkgdiff
@@ -1,6 +1,6 @@
#!@SH@
#
-# $NetBSD: pkgdiff,v 1.21 2011/02/02 23:34:48 wiz Exp $
+# $NetBSD: pkgdiff,v 1.22 2012/09/16 18:09:53 dholland Exp $
#
# Usage: pkgdiff newfile
# pkgdiff oldfile newfile
@@ -96,14 +96,29 @@ dodiff() {
esac
}
+dogrep() {
+ egrep $* '\$(NetBSD|Author|Date|Header|Id|Locker|Log|Name|RCSfile|Revision|Source|State)(:.*)?\$'
+}
+
case x"$PKGDIFF_FMT" in x)
lines=3
PKGDIFF_FMT="-p"
-while [ `dodiff "$PKGDIFF_FMT" -U $lines "$old" "$new" | egrep -c '\\$(NetBSD|Author|Date|Header|Id|Locker|Log|Name|RCSfile|Revision|Source|State)(:.*)?\\$'` != 0 ]
+while [ `dodiff "$PKGDIFF_FMT" -U $lines "$old" "$new" | dogrep -c` != 0 ]
do
lines=`expr $lines - 1`
+ if [ $lines = 0x -a x"$PKGDIFF_FMT" = x-p ]; then
+ # Try without -p instead
+ lines=3
+ PKGDIFF_FMT=""
+ continue
+ fi
if [ $lines = 0 ]; then
echo "Cannot strip away RCS IDs, please handle manually!" >&2
+ echo "These are the matching lines:" >&2
+ dodiff "$PKGDIFF_FMT" -U $lines "$old" "$new" | dogrep |\
+ sed -e 's/^/ /' >&2
+ echo "Setting PKGDIFF_FMT might help." >&2
+ echo "Otherwise you may need to run diff by hand." >&2
exit 1
fi
done