diff options
author | rillig <rillig@pkgsrc.org> | 2009-07-26 19:30:33 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2009-07-26 19:30:33 +0000 |
commit | 257c9ea8a0e21fff627e531901594b27627ce1a7 (patch) | |
tree | 18e8e07c8685225023ed2cd211a774f8367dc1ad /pkgtools | |
parent | a6362bd6868fd1a4b24eb9668a785c3d4aaf6e9a (diff) | |
download | pkgsrc-257c9ea8a0e21fff627e531901594b27627ce1a7.tar.gz |
Added support for LICENSE_FILE, OPSYSVARS and @pkgdir.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 7022810a2ad..04b4dcf1396 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.pl,v 1.817 2009/07/22 22:11:54 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.818 2009/07/26 19:30:33 rillig Exp $ # # pkglint - static analyzer and checker for pkgsrc packages @@ -2716,6 +2716,21 @@ sub var_is_used($) { return false; } +sub def_var($$) { + my ($line, $varname) = @_; + my $varcanon = varname_canon($varname); + + if (defined($mkctx_vardef)) { + $mkctx_vardef->{$varname} = $line; + $mkctx_vardef->{$varcanon} = $line; + } + + if (defined($pkgctx_vardef)) { + $pkgctx_vardef->{$varname} = $line; + $pkgctx_vardef->{$varcanon} = $line; + } +} + sub var_is_defined($) { my ($varname) = @_; my $varcanon = varname_canon($varname); @@ -5874,6 +5889,7 @@ sub checklines_package_Makefile_varorder($) { [ "Legal issues", optional, [ [ "LICENSE", once ], + [ "LICENSE_FILE", optional ], [ "RESTRICTED", optional ], [ "NO_BIN_ON_CDROM", optional ], [ "NO_BIN_ON_FTP", optional ], @@ -6049,6 +6065,12 @@ sub checklines_mk($) { use_var($svar, varname_canon($svar)); $opt_debug_misc and $line->log_debug("varuse $svar"); } + + } elsif ($varcanon eq "OPSYSVARS") { + foreach my $osvar (split(/\s+/, $line->get("value"))) { + use_var($line, "$osvar.*"); + def_var($line, $osvar); + } } } @@ -7687,6 +7709,9 @@ sub checkfile_PLIST($) { } } + } elsif ($cmd eq "pkgdir") { + # TODO: What can we check here? + } else { $line->log_warning("Unknown PLIST directive \"\@$cmd\"."); } |