summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig>2005-11-10 12:04:11 +0000
committerrillig <rillig>2005-11-10 12:04:11 +0000
commit8ff5a9d4ed0fcd2e38b19c6e78b733059f753b1d (patch)
tree6e5fd4a08690635255520548c36c1d3ce8d716fd /pkgtools
parent12c76021fd7926493a25e87b6d5966eaebd692a8 (diff)
downloadpkgsrc-8ff5a9d4ed0fcd2e38b19c6e78b733059f753b1d.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.map3
-rw-r--r--pkgtools/pkglint/files/pkglint.pl35
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;