diff options
| author | wiz <wiz@pkgsrc.org> | 2016-02-10 16:00:10 +0000 |
|---|---|---|
| committer | wiz <wiz@pkgsrc.org> | 2016-02-10 16:00:10 +0000 |
| commit | d5944a1187ce768d28f7256a11ac0b9a424b237e (patch) | |
| tree | 7ff1eba971036c21a749d64af74fb8a9f31ff2b9 /pkgtools/pkgdiff/files/patchdiff.pl | |
| parent | ac36d5873cdae317e9c54ebd091f9894aa190644 (diff) | |
| download | pkgsrc-d5944a1187ce768d28f7256a11ac0b9a424b237e.tar.gz | |
pkgdiff: move automatic cleanup of unnecessary patches from patchdiff(1)
to mkpatches(1).
Requested by jperkin.
Update man pages.
Bump version.
Diffstat (limited to 'pkgtools/pkgdiff/files/patchdiff.pl')
| -rwxr-xr-x | pkgtools/pkgdiff/files/patchdiff.pl | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/pkgtools/pkgdiff/files/patchdiff.pl b/pkgtools/pkgdiff/files/patchdiff.pl index 64bdee637b6..33249fd7acb 100755 --- a/pkgtools/pkgdiff/files/patchdiff.pl +++ b/pkgtools/pkgdiff/files/patchdiff.pl @@ -1,11 +1,12 @@ #!@PERL5@ # -# $NetBSD: patchdiff.pl,v 1.15 2011/03/04 15:57:07 wiz Exp $ +# $NetBSD: patchdiff.pl,v 1.16 2016/02/10 16:00:10 wiz Exp $ # # patchdiff: compares a set of patches in the patch dir with their predecessors # # Copyright (c) 2000, 2011 by Dieter Baron <dillo@giga.or.at> and # Thomas Klausner <wiz@NetBSD.org> +# Copyright (c) 2016 Thomas Klausner <wiz@NetBSD.org> # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -120,26 +121,7 @@ foreach (sort <HANDLE>) { if (! -f "$new") { print "File $new removed\n"; } else { -# system("diff",$orig{$patch},$new{$patch}); $diff=`diff $orig $new`; - # the following regex try to eliminate uninteresting differences - # 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; - # . the name of the input file changed - # (if the name of the output file has changed, patches - # won't get matched up anyway) - # . time of the input and/or output file changed - # . line numbers changed - $diff=~s/^[\d,]+c[\d,]+\n(?:.\s---\s(:?\S+).*\n)?(?:.\s\+\+\+\s(\S+).*\n)?(?:.\s@@\s(?:.*)\s@@.*\n)?---\n(?:.\s---\s\S+.*\n)?(?:.\s\+\+\+\s\S+.*\n)?(?:.\s@@\s.*\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 (! -s $orig) { print "New file $new\n"; @@ -147,8 +129,7 @@ foreach (sort <HANDLE>) { print "Comparing $orig to $new\n$diff"; } } else { - # restore previous version to get rid of uninteresting diffs - rename "$orig", "$new"; + print "$orig and $new are the same"; } } } |
