Ignore more uninteresting output.

Tries to address PR 39291.

Welcome to 0.121.
This commit is contained in:
wiz 2008-11-05 23:18:18 +00:00
parent 87917e128c
commit 208ed5a45e
2 changed files with 20 additions and 5 deletions

View file

@ -1,7 +1,7 @@
# $NetBSD: Makefile,v 1.65 2008/02/16 22:21:35 apb Exp $ # $NetBSD: Makefile,v 1.66 2008/11/05 23:18:18 wiz Exp $
# #
DISTNAME= pkgdiff-0.120 DISTNAME= pkgdiff-0.121
CATEGORIES= pkgtools devel CATEGORIES= pkgtools devel
MASTER_SITES= # empty MASTER_SITES= # empty
DISTFILES= # empty DISTFILES= # empty

View file

@ -1,6 +1,6 @@
#!@PERL5@ #!@PERL5@
# #
# $NetBSD: patchdiff.pl,v 1.9 2008/02/16 22:21:35 apb Exp $ # $NetBSD: patchdiff.pl,v 1.10 2008/11/05 23:18:18 wiz Exp $
# #
# patchdiff: compares a set of patches patch-aa, patch-ab, ... in # patchdiff: compares a set of patches patch-aa, patch-ab, ... in
# $WRKDIR/.newpatches in the with another set in patches. # $WRKDIR/.newpatches in the with another set in patches.
@ -96,8 +96,23 @@ foreach $patch (keys%new) {
if (defined($orig{$patch})) { if (defined($orig{$patch})) {
# system("diff",$orig{$patch},$new{$patch}); # system("diff",$orig{$patch},$new{$patch});
$diff=`diff $orig{$patch} $new{$patch}`; $diff=`diff $orig{$patch} $new{$patch}`;
$diff=~s/^\dc\d\n..\$[N]etBSD.*\$\n---\n..\$[N]etBSD.*\$\n//m; # the following regex try to eliminate uninteresting differences
$diff=~s/^\dc\d\n..\+\+\+.*\n---\n..\+\+\+.*\n//m; # The general structure of the diffs-to-be-removed is:
# 25c25
# < --- something.orig 2008-08-08 08:08
# ---
# > --- something.orig 2008-08-08 18:08
#
# In particular, remove hunks with:
# . NetBSD RCS Id tag differences
$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;
# . 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;
# . only line numbers changed
$diff=~s/^\d+c\d+\n.\s@@\s.*\s@@.*\n---\n.\s@@\s.*\s@@.*\n//mg;
if ($diff) { if ($diff) {
print "Comparing $orig{$patch} to $new{$patch}\n$diff"; print "Comparing $orig{$patch} to $new{$patch}\n$diff";
} }