diff options
author | rillig <rillig@pkgsrc.org> | 2005-11-10 12:04:11 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2005-11-10 12:04:11 +0000 |
commit | e19e0913cd9faf4a118dd6562133b028a22734e1 (patch) | |
tree | 6e5fd4a08690635255520548c36c1d3ce8d716fd /pkgtools | |
parent | e7ac2c73bf84e35ef6c590181c6033fde1c3cb25 (diff) | |
download | pkgsrc-e19e0913cd9faf4a118dd6562133b028a22734e1.tar.gz |
Moved the checks for the COMMENT from checklines_package_Makefile() to
checktext_basic_vartype() to shorten the former subroutine.
No user-visible changes.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/files/makevars.map | 3 | ||||
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 35 |
2 files changed, 19 insertions, 19 deletions
diff --git a/pkgtools/pkglint/files/makevars.map b/pkgtools/pkglint/files/makevars.map index 6fa54a9546a..b5f3ae3d961 100644 --- a/pkgtools/pkglint/files/makevars.map +++ b/pkgtools/pkglint/files/makevars.map @@ -1,4 +1,4 @@ -# $NetBSD: makevars.map,v 1.29 2005/11/07 00:45:01 rillig Exp $ +# $NetBSD: makevars.map,v 1.30 2005/11/10 12:04:11 rillig Exp $ # # This file contains the guessed type of some variables, according to @@ -60,6 +60,7 @@ BUILTIN_X11_VERSION Readonly CATEGORIES List* of Category CC_VERSION Readonly CFLAGS List +COMMENT Comment CONFIGURE_ARGS List CONFIGURE_DIRS List* of WrksrcSubdirectory CONFIGURE_ENV List diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index a1640fb1c3b..39f1cea2009 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.345 2005/11/10 11:14:03 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.346 2005/11/10 12:04:11 rillig Exp $ # # This version contains lots of changes necessary for NetBSD packages # done by: @@ -1522,6 +1522,20 @@ sub checktext_basic_vartype($$$$$) { $line->log_error("Invalid category \"${value}\"."); } + } elsif ($type eq "Comment") { + if ($value =~ qr"^(a|an)\s+"i) { + $line->log_warning("COMMENT should not begin with '$1'."); + } + if ($value =~ qr"^[a-z]") { + $line->log_warning("COMMENT should start with a capital letter."); + } + if ($value =~ qr"\.$") { + $line->log_warning("COMMENT should not end with a period."); + } + if (length($value) > 70) { + $line->log_warning("COMMENT should not be longer than 70 characters."); + } + } elsif ($type eq "Dependency") { if ($value =~ regex_unresolved) { # don't even try to check anything @@ -2008,11 +2022,11 @@ sub checklines_package_Makefile_varorder($) { my ($lineno, $sectindex, $varindex) = (0, -1, 0); my ($next_section, $vars, $below, $below_what) = (true, undef, {}, undef); - # In each interation, one of the following becomes true: + # In each iteration, one of the following becomes true: # - new.lineno > old.lineno # - new.sectindex > old.sectindex # - new.sectindex == old.sectindex && new.varindex > old.varindex - # - next_section == true + # - new.next_section == true && old.next_section == false while ($lineno <= $#{$lines}) { my $line = $lines->[$lineno]; my $text = $line->text; @@ -2112,21 +2126,6 @@ sub checklines_package_Makefile($) { #$line->log_error("Variable names starting with an underscore are reserved for internal pkgsrc use."); } - if ($varname eq "COMMENT") { - if ($value =~ qr"^(a|an)\s+"i) { - $line->log_warning("COMMENT should not begin with '$1'."); - } - if ($value =~ qr"^[a-z]") { - $line->log_warning("COMMENT should start with a capital letter."); - } - if ($value =~ qr"\.$") { - $line->log_warning("COMMENT should not end with a period."); - } - if (length($value) > 70) { - $line->log_warning("COMMENT should not be longer than 70 characters."); - } - } - if ($varname eq "PERL5_PACKLIST" && defined($pkgname) && $pkgname =~ qr"^p5-(.*)-[0-9].*") { my ($guess) = ($1); $guess =~ s/-/\//g; |