diff options
author | rillig <rillig> | 2006-07-24 09:25:57 +0000 |
---|---|---|
committer | rillig <rillig> | 2006-07-24 09:25:57 +0000 |
commit | 2d51e192be30387b78f0466fc07a78ebdd9f5439 (patch) | |
tree | 2d54c56ca43560632610573295f6cb8762cfb002 /pkgtools | |
parent | 6034223d03a508fda84fc529fad89db55f5332c5 (diff) | |
download | pkgsrc-2d51e192be30387b78f0466fc07a78ebdd9f5439.tar.gz |
In addition to ${SED} and ${TR}, sed and tr should not be used in the
install phase.
Stricter checks for manual pages in PLIST files.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 43 |
1 files changed, 35 insertions, 8 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 65420958dab..a6aeb4cfd47 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.pl,v 1.661 2006/07/22 06:47:40 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.662 2006/07/24 09:25:57 rillig Exp $ # # pkglint - static analyzer and checker for pkgsrc packages @@ -4002,8 +4002,8 @@ sub checkline_mk_shellcmd_use($$) { ${PAX} )); use constant discouraged_install_commands => array_to_hash(qw( - ${SED} - ${TR} + sed ${SED} + tr ${TR} )); if (defined($mkctx_target) && $mkctx_target =~ qr"^(?:pre|do|post)-install") { @@ -4189,6 +4189,8 @@ sub checkline_mk_shelltext($$) { "capable implementation of that tool will be selected."); } + checkline_mk_shellcmd_use($line, $shellword); + } elsif ($shellword =~ qr"^\$\{([\w_]+)\}$" && defined($type = get_variable_type($line, $1)) && $type->basic_type eq "ShellCommand") { checkline_mk_shellcmd_use($line, $shellword); @@ -4889,6 +4891,13 @@ sub checkline_mk_vartype_basic($$$$$$$$) { "Examples: NetBSD-*-i386, *-*-*, Linux-*-*."); } + } elsif ($type eq "PrefixPathname") { + if ($value =~ qr"^man/(.*)") { + my ($mansubdir) = ($1); + + $line->log_warning("Please use \"\${PKGMANDIR}/${mansubdir}\" instead of \"${value}\"."); + } + } elsif ($type eq "RelativePkgDir") { checkline_relative_pkgdir($line, $value); @@ -6887,14 +6896,26 @@ sub checkfile_PLIST($) { } } - } elsif ($text =~ qr"^man/cat(\d)/(.*)\.\d$") { - my ($cat, $manpage) = ($1, $2); - if (!exists($all_files->{"man/man${cat}/${manpage}.${cat}"})) { + } elsif ($text =~ qr"^man/(cat|man)(\w+)/(.*?)\.(\w+)(\.gz)?$") { + my ($cat_or_man, $section, $manpage, $ext, $gz) = ($1, $2, $3, $4, $5); + + if ($section !~ qr"^[\dln]$") { + $line->log_warning("Unknown section \"${section}\" for manual page."); + } + + if ($cat_or_man eq "cat" && !exists($all_files->{"man/man${section}/${manpage}.${section}"})) { $line->log_warning("Preformatted manual page without unformatted one."); } - } elsif ($text =~ qr"^man/man(\d)/([^/]+)\.\1(\.gz)?$") { - my ($cat, $manpage, $gz) = ($1, $2, $3); + if ($cat_or_man eq "cat") { + if ($ext ne "0") { + $line->log_warning("Preformatted manual pages should end in \".0\"."); + } + } else { + if ($section ne $ext) { + $line->log_warning("Mismatch between the section (${section}) and extension (${ext}) of the manual page."); + } + } if (defined($gz)) { $line->log_note("The .gz extension is unnecessary for manual pages."); @@ -6905,6 +6926,12 @@ sub checkfile_PLIST($) { "or not."); } + } elsif ($text =~ qr"^man/cat") { + $line->log_warning("Invalid filename \"${text}\" for preformatted manual page."); + + } elsif ($text =~ qr"^man/man") { + $line->log_warning("Invalid filename \"${text}\" for unformatted manual page."); + } elsif ($text =~ qr"^sbin/(.*)") { my ($binname) = ($1); |