From 7790aaa7cfb31cdbd3bcec8972493cdde61ff81b Mon Sep 17 00:00:00 2001 From: sbd Date: Sun, 4 Jul 2010 22:18:28 +0000 Subject: 1) Add a space to the second white-space block, when matching filenames as some diff version must uses spaces to separate the filename and timestamp (that or somepeople do cut-n-pasting of patches). 2) add the comma "," to the pattern used to match line numbers, to match POSIX. --- pkgtools/pkgdiff/files/patchdiff.pl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgtools/pkgdiff/files/patchdiff.pl b/pkgtools/pkgdiff/files/patchdiff.pl index e03eaa0e370..be0073d858b 100755 --- a/pkgtools/pkgdiff/files/patchdiff.pl +++ b/pkgtools/pkgdiff/files/patchdiff.pl @@ -1,6 +1,6 @@ #!@PERL5@ # -# $NetBSD: patchdiff.pl,v 1.10 2008/11/05 23:18:18 wiz Exp $ +# $NetBSD: patchdiff.pl,v 1.11 2010/07/04 22:18:28 sbd Exp $ # # patchdiff: compares a set of patches patch-aa, patch-ab, ... in # $WRKDIR/.newpatches in the with another set in patches. @@ -23,7 +23,7 @@ sub getfilename { local *handle; open(handle, $fname); while () { - next unless m/^\+\+\+[ ]([^ ]*)/; + next unless m/^\+\+\+[ ]([^ ]*)/; close(handle); $_ = $1; chomp(); @@ -105,14 +105,14 @@ foreach $patch (keys%new) { # # In particular, remove hunks with: # . NetBSD RCS Id tag differences - $diff=~s/^\d+c\d+\n..\$[N]etBSD.*\$\n---\n..\$[N]etBSD.*\$\n//m; + $diff=~s/^[\d,]+c[\d,]+\n..\$[N]etBSD.*\$\n---\n..\$[N]etBSD.*\$\n//m; # . only the name or date of the output file changed - $diff=~s/^\d+c\d+\n..\+\+\+.*\n---\n..\+\+\+.*\n//m; + $diff=~s/^[\d,]+c[\d,]+\n..\+\+\+.*\n---\n..\+\+\+.*\n//m; # . only the name or date of the input file changed - $diff=~s/^\d+c\d+\n.\s---\s.*\.orig\s.*\n---\n.\s---\s.*\n//m; - $diff=~s/^\d+c\d+\n.\s---\s.*\n---\n.\s---\s.*\.orig\s.*\n//m; + $diff=~s/^[\d,]+c[\d,]+\n.\s---\s.*\.orig\s.*\n---\n.\s---\s.*\n//m; + $diff=~s/^[\d,]+c[\d,]+\n.\s---\s.*\n---\n.\s---\s.*\.orig\s.*\n//m; # . only line numbers changed - $diff=~s/^\d+c\d+\n.\s@@\s.*\s@@.*\n---\n.\s@@\s.*\s@@.*\n//mg; + $diff=~s/^[\d,]+c[\d,]+\n.\s@@\s.*\s@@.*\n---\n.\s@@\s.*\s@@.*\n//mg; if ($diff) { print "Comparing $orig{$patch} to $new{$patch}\n$diff"; } -- cgit v1.2.3