summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig>2005-12-01 17:00:52 +0000
committerrillig <rillig>2005-12-01 17:00:52 +0000
commit49c3235f17c680699cb5effb407de933c14b62f6 (patch)
tree8a05749e59d35c18fa6fe25dc99de22a802a065e /pkgtools
parent310467a6577d3423fdd135cf3e817073763174fc (diff)
downloadpkgsrc-49c3235f17c680699cb5effb407de933c14b62f6.tar.gz
- RCS tags that appear in the @@ lines of patches in unified diff format
can be fixed automatically.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/files/pkglint.pl16
1 files changed, 14 insertions, 2 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index 045e08c2ef8..987c3ad3a64 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -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 replace($$$) {
}
}
}
+sub set_text($$) {
+ my ($self, $text) = @_;
+ $self->[PHYSLINES] = [[0, "$text\n"]];
+ $self->[CHANGED] = true;
+}
#== End of PkgLint::FileUtil::Line ========================================
@@ -1540,7 +1545,12 @@ sub checkfile_patches_patch($) {
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 @@ sub checkfile_patches_patch($) {
checklines_trailing_empty_lines($lines);
checklines_multiple_patches($lines);
+
+ autofix($lines);
}
#