pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files - RCS tags that appear in the @...
details: https://anonhg.NetBSD.org/pkgsrc/rev/0d130a06a796
branches: trunk
changeset: 503863:0d130a06a796
user: rillig <rillig%pkgsrc.org@localhost>
date: Thu Dec 01 17:00:52 2005 +0000
description:
- RCS tags that appear in the @@ lines of patches in unified diff format
can be fixed automatically.
diffstat:
pkgtools/pkglint/files/pkglint.pl | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diffs (47 lines):
diff -r 57d531e2cac0 -r 0d130a06a796 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Thu Dec 01 16:41:29 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Thu Dec 01 17:00:52 2005 +0000
@@ -11,7 +11,7 @@
# Freely redistributable. Absolutely no warranty.
#
# From Id: portlint.pl,v 1.64 1998/02/28 02:34:05 itojun Exp
-# $NetBSD: pkglint.pl,v 1.406 2005/12/01 16:11:27 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.407 2005/12/01 17:00:52 rillig Exp $
#
# This version contains lots of changes necessary for NetBSD packages
# done by:
@@ -401,6 +401,11 @@
}
}
}
+sub set_text($$) {
+ my ($self, $text) = @_;
+ $self->[PHYSLINES] = [[0, "$text\n"]];
+ $self->[CHANGED] = true;
+}
#== End of PkgLint::FileUtil::Line ========================================
@@ -1540,7 +1545,12 @@
foreach my $line (@{$lines}[1..$#{$lines}]) {
if ($line->text =~ qr"\$(Author|Date|Header|Id|Locker|Log|Name|RCSfile|Revision|Source|State|$opt_rcsidstring)[:\$]") {
my ($tag) = ($1);
- $line->log_warning("Possible RCS tag \"\$${tag}\$\". Please remove it by reducing the number of context lines using pkgdiff or \"diff -U[210]\".");
+ if ($line->text =~ qr"^(\@\@.*?\@\@)") {
+ $line->log_warning("Patches should not contain RCS tags.");
+ $line->set_text($1);
+ } else {
+ $line->log_warning("Possible RCS tag \"\$${tag}\$\". Please remove it by reducing the number of context lines using pkgdiff or \"diff -U[210]\".");
+ }
}
if ($line->text =~ qr"^\+") {
@@ -1590,6 +1600,8 @@
checklines_trailing_empty_lines($lines);
checklines_multiple_patches($lines);
+
+ autofix($lines);
}
#
Home |
Main Index |
Thread Index |
Old Index