diff options
author | sbd <sbd> | 2010-07-04 22:18:28 +0000 |
---|---|---|
committer | sbd <sbd> | 2010-07-04 22:18:28 +0000 |
commit | 7790aaa7cfb31cdbd3bcec8972493cdde61ff81b (patch) | |
tree | 27cf1efc7005bb30ba2ba3b89031278b79c3778b | |
parent | 16f65f12ea31489fa4395f248fc97291b99087e9 (diff) | |
download | pkgsrc-7790aaa7cfb31cdbd3bcec8972493cdde61ff81b.tar.gz |
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.
-rwxr-xr-x | pkgtools/pkgdiff/files/patchdiff.pl | 14 |
1 files 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 (<handle>) { - 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"; } |