diff options
author | rillig <rillig@pkgsrc.org> | 2005-09-22 01:46:46 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2005-09-22 01:46:46 +0000 |
commit | 46ed79c39236b305293c5d1d56c9cf1986924dd1 (patch) | |
tree | 9f9aa2bcd103d539c13fd59006838acc9290e6c6 /pkgtools | |
parent | 5c0ccf3f32b6f68c3d7e29568b6286817100c49a (diff) | |
download | pkgsrc-46ed79c39236b305293c5d1d56c9cf1986924dd1.tar.gz |
The diagnostics for the COMMENT variable checks include the location and
are therefore enabled by default. Requested by wiz.
Set the version to 4.21.1.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/Makefile | 4 | ||||
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 43 |
2 files changed, 27 insertions, 20 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile index 137adccff05..dd0cbae0b76 100644 --- a/pkgtools/pkglint/Makefile +++ b/pkgtools/pkglint/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.249 2005/09/09 12:16:29 rillig Exp $ +# $NetBSD: Makefile,v 1.250 2005/09/22 01:46:46 rillig Exp $ # -DISTNAME= pkglint-4.21 +DISTNAME= pkglint-4.21.1 CATEGORIES= pkgtools devel MASTER_SITES= # empty DISTFILES= # empty diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index deccabc4323..77bfb7e4949 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.283 2005/09/09 11:05:00 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.284 2005/09/22 01:46:46 rillig Exp $ # # This version contains lots of changes necessary for NetBSD packages # done by: @@ -1448,7 +1448,10 @@ sub checklines_direct_tools($) { } } -sub checklines_Makefile($) { +# This subroutine contains "local" checks that can be made looking only +# at a single line at a time. The other checks are in +# checkfile_package_Makefile. +sub checklines_package_Makefile($) { my ($lines) = @_; foreach my $line (@{$lines}) { @@ -1463,6 +1466,25 @@ sub checklines_Makefile($) { if ($text =~ /^\040{8}/) { $line->log_warning("Use tab (not spaces) to make indentation."); } + + if ($text =~ $regex_varassign) { + my ($varname, $op, $value) = ($1, $2, $3); + + 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."); + } + } + } } checklines_trailing_empty_lines($lines); @@ -1557,7 +1579,7 @@ sub checkfile_package_Makefile($$$$$) { log_subinfo("checkfile_package_Makefile", $fname, NO_LINE_NUMBER, undef); checkperms($fname); - checklines_Makefile($lines); + checklines_package_Makefile($lines); $abspkgdir = Cwd::abs_path($dir); $category = basename(dirname($abspkgdir)); @@ -1878,21 +1900,6 @@ sub checkfile_package_Makefile($$$$$) { # warnings for missing COMMENT if ($tmp !~ /\nCOMMENT=\s*(.*)$/) { $opt_warn_vague && log_error(NO_FILE, NO_LINE_NUMBER, "Please add a short COMMENT describing the package."); - } else { - # and its properties: - my $tmp2 = $1; - if ($tmp2 =~ /\.$/i) { - $opt_warn_vague && log_warning(NO_FILE, NO_LINE_NUMBER, "COMMENT should not end with a '.' (period)."); - } - if ($tmp2 =~ /^(a|an) /i) { - $opt_warn_vague && log_warning(NO_FILE, NO_LINE_NUMBER, "COMMENT should not begin with '$1 '."); - } - if ($tmp2 =~ /^[a-z]/) { - $opt_warn_vague && log_warning(NO_FILE, NO_LINE_NUMBER, "COMMENT should start with a capital letter."); - } - if (length($tmp2) > 70) { - $opt_warn_vague && log_warning(NO_FILE, NO_LINE_NUMBER, "COMMENT should not be longer than 70 characters."); - } } checkearlier($tmp, @varnames); |