pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkgdiff Update to version 0.118: pkgdiff fix ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/28f8975af7f3
branches:  trunk
changeset: 497687:28f8975af7f3
user:      seb <seb%pkgsrc.org@localhost>
date:      Tue Aug 02 12:16:19 2005 +0000

description:
Update to version 0.118: pkgdiff fix and tuning.

Fix the automagic tuning of the number of unified diff context
lines.  It was broken since previous commit to files/pkgdiff.

Also arguments '-u' and '-U NUM' to GNU diffutils 2.8.1, as seen
in NetBSD 2.0_STABLE and current, are not intended to be used
together. Hence only '-U NUM' is now specified. I did not reverted
to the '-u -NUM' form used before as it seems undesirable.

Please note that if PKGDIFF_FMT is specified in the environment,
for testing or debugging purposes, we skip the automagic tuning of
the number of unified diff context lines.  The user probably wants
to try another diff format, as suggested in the commit log of
revision 1.12 of files/pkgdiff. So there is no point in adding '-U
NUM' to PKGDIFF_FMT: it may just not work. See:

$ diff -c -U 1 /dev/null /dev/null
diff: conflicting output style options
diff: Try `diff --help' for more information.

While here save a few basename(1) runs.

diffstat:

 pkgtools/pkgdiff/Makefile      |   4 ++--
 pkgtools/pkgdiff/files/pkgdiff |  13 +++++++++----
 2 files changed, 11 insertions(+), 6 deletions(-)

diffs (59 lines):

diff -r d829fe3a78f9 -r 28f8975af7f3 pkgtools/pkgdiff/Makefile
--- a/pkgtools/pkgdiff/Makefile Tue Aug 02 11:31:39 2005 +0000
+++ b/pkgtools/pkgdiff/Makefile Tue Aug 02 12:16:19 2005 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.56 2005/07/16 19:10:40 jlam Exp $
+# $NetBSD: Makefile,v 1.57 2005/08/02 12:16:19 seb Exp $
 #
 
-DISTNAME=      pkgdiff-0.117
+DISTNAME=      pkgdiff-0.118
 CATEGORIES=    pkgtools devel
 MASTER_SITES=  # empty
 DISTFILES=     # empty
diff -r d829fe3a78f9 -r 28f8975af7f3 pkgtools/pkgdiff/files/pkgdiff
--- a/pkgtools/pkgdiff/files/pkgdiff    Tue Aug 02 11:31:39 2005 +0000
+++ b/pkgtools/pkgdiff/files/pkgdiff    Tue Aug 02 12:16:19 2005 +0000
@@ -1,6 +1,6 @@
 #!@SH@
 #
-# $NetBSD: pkgdiff,v 1.15 2005/05/21 01:24:34 rh Exp $
+# $NetBSD: pkgdiff,v 1.16 2005/08/02 12:16:19 seb Exp $
 #
 # Usage: pkgdiff newfile
 #        pkgdiff oldfile newfile
@@ -26,9 +26,10 @@
        old="$1"
        new="$2"
 fi
+basename_new="`basename $new`"
 
 dodiff() {
-       case x"`basename $new`" in
+       case x"$basename_new" in
                xconfigure)
                @DIFF@ -I '\(echo .*as_me:[0-9][0-9]*:\|echo .*configure:[0-9][0-9]*:\|line [0-9][0-9]* "configure\)' $*
                ;;
@@ -37,9 +38,10 @@
        esac
 }
 
+case x"$PKGDIFF_FMT" in x)
 lines=3
-: ${PKGDIFF_FMT:=-u -p -U $lines}
-while [ `dodiff "$PKGDIFF_FMT" "$old" "$new" | egrep -c '\\$(NetBSD|Author|Date|Header|Id|Locker|Log|Name|RCSfile|Revision|Source|State)(:.*)?\\$'`  !=  0 ]
+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 ]
 do
        lines=`expr $lines - 1`
        if [ $lines = 0 ]; then
@@ -47,6 +49,9 @@
                exit 1
        fi
 done
+PKGDIFF_FMT="${PKGDIFF_FMT} -U $lines"
+;;
+esac # PKGDIFF_FMT unset or null
 
 if dodiff -q "$PKGDIFF_FMT" "$old" "$new" > /dev/null
 then



Home | Main Index | Thread Index | Old Index