diff options
author | dholland <dholland@pkgsrc.org> | 2012-09-16 18:09:53 +0000 |
---|---|---|
committer | dholland <dholland@pkgsrc.org> | 2012-09-16 18:09:53 +0000 |
commit | a7b3d88e06981e871e56704376a87e16626eac27 (patch) | |
tree | 17d37c84f1bc3b7c7c7c15ae55eea84b5e8a6709 | |
parent | 6d908ed3fe6c2e158f5ddfbab2bf707a03b19547 (diff) | |
download | pkgsrc-a7b3d88e06981e871e56704376a87e16626eac27.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.
-rw-r--r-- | pkgtools/pkgdiff/Makefile | 4 | ||||
-rwxr-xr-x | pkgtools/pkgdiff/files/pkgdiff | 19 |
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 |