diff options
author | rillig <rillig@pkgsrc.org> | 2006-05-23 08:59:47 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2006-05-23 08:59:47 +0000 |
commit | ae90a923e0e53d75548299a632ad2bc690ebc2a9 (patch) | |
tree | bbb9a57298fcbc7fa8fb1b18c3d56f3811bd0d92 /pkgtools/pkglint | |
parent | a7dd2bac208c88dcb2a2228b47e56adcae31cda2 (diff) | |
download | pkgsrc-ae90a923e0e53d75548299a632ad2bc690ebc2a9.tar.gz |
- _FETCH_MESSAGE, BUILDLINK_RECOMMENDED.* and BUILDLINK_DEPENDS.* are
deprecated.
- CONFLICT is just a spelling mistake and therefore should not appear
in the list of deprecated variables.
- Made handling of parameterized variables more uniform.
Diffstat (limited to 'pkgtools/pkglint')
-rw-r--r-- | pkgtools/pkglint/files/deprecated.map | 6 | ||||
-rw-r--r-- | pkgtools/pkglint/files/makevars.map | 5 | ||||
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 26 |
3 files changed, 26 insertions, 11 deletions
diff --git a/pkgtools/pkglint/files/deprecated.map b/pkgtools/pkglint/files/deprecated.map index 2bfe833c287..d0649ddc023 100644 --- a/pkgtools/pkglint/files/deprecated.map +++ b/pkgtools/pkglint/files/deprecated.map @@ -1,4 +1,4 @@ -# $NetBSD: deprecated.map,v 1.34 2006/05/10 08:17:25 rillig Exp $ +# $NetBSD: deprecated.map,v 1.35 2006/05/23 08:59:47 rillig Exp $ # # This file contains names of Makefile variables and a short explanation @@ -40,7 +40,6 @@ USE_SSL Include "../../security/openssl/buildlink3.mk" instead. USE_PERL5 Use USE_TOOLS+=perl or USE_TOOLS+=perl:run instead. # October 2005 -CONFLICT Use CONFLICTS instead. NO_TOOLS You can just remove it. NO_WRAPPER You can just remove it. @@ -82,3 +81,6 @@ USE_MSGFMT_PLURALS Use USE_TOOLS+=msgfmt instead. # May 2006 EXTRACT_USING_PAX Use "EXTRACT_OPTS=-t pax" instead. NO_EXTRACT It doesn't exist anymore. +_FETCH_MESSAGE Use FETCH_MESSAGE (different format) instead. +BUILDLINK_DEPENDS.* Use BUILDLINK_API_DEPENDS.* instead. +BUILDLINK_RECOMMENDED.* Use BUILDLINK_ABI_DEPENDS.* instead. diff --git a/pkgtools/pkglint/files/makevars.map b/pkgtools/pkglint/files/makevars.map index 29938fb0a53..3d4b3176766 100644 --- a/pkgtools/pkglint/files/makevars.map +++ b/pkgtools/pkglint/files/makevars.map @@ -1,4 +1,4 @@ -# $NetBSD: makevars.map,v 1.93 2006/05/22 07:41:03 rillig Exp $ +# $NetBSD: makevars.map,v 1.94 2006/05/23 08:59:47 rillig Exp $ # # This file contains the guessed type of some variables, according to @@ -332,6 +332,7 @@ MASTER_SITE_SUSE List of URL MASTER_SITE_TEX_CTAN List of URL MASTER_SITE_XCONTRIB List of URL MASTER_SITE_XEMACS List of URL +MESSAGE Unchecked [] MESSAGE_SRC List of Pathname [m:as,c:a,o:ads] MESSAGE_SUBST List of ShellWord [c:a,m:a,o:a] MYSQL_VERSIONS_ACCEPTED List of { 40 41 50 } [m:s] @@ -417,7 +418,7 @@ PKG_PRESERVE Yes [m:s] PKG_SHELL Pathname [m:s,c:s] PKG_SHELL.* Pathname [m:s,c:s] PKG_SHLIBTOOL Pathname -PKG_SKIP_REASON List of ShellWord +PKG_SKIP_REASON List of ShellWord [*:a] PKG_SUGGESTED_OPTIONS List of Option [o:as,m:as,c:s] PKG_SUPPORTED_OPTIONS List of Option [o:as,m:as,c:s] PKG_SYSCONFDIR Pathname diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index b0c5d8101e0..4092bc24cd4 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.pl,v 1.588 2006/05/22 10:22:36 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.589 2006/05/23 08:59:47 rillig Exp $ # # pkglint - static analyzer and checker for pkgsrc packages @@ -2748,9 +2748,10 @@ sub checkline_mk_text($$) { while ($rest =~ s/(?:^|[^\$])\$\{([-A-Z0-9a-z_]+)(\.[\-0-9A-Z_a-z]+)?(?::[^\}]+)?\}//) { my ($varbase, $varext) = ($1, $2); my $varname = $varbase . (defined($varext) ? $varext : ""); + my $varcanon = varname_canon($varname); my $instead = (exists($depr_map->{$varname})) ? $depr_map->{$varname} - : (exists($depr_map->{$varbase})) ? $depr_map->{$varbase} + : (exists($depr_map->{$varcanon})) ? $depr_map->{$varcanon} : undef; if (defined($instead)) { @@ -3928,7 +3929,8 @@ sub checkline_mk_vartype($$$$$) { sub checkline_mk_varassign($$$$$) { my ($line, $varname, $op, $value, $comment) = @_; - my $varbase = ($varname =~ qr"(.+?)\..*") ? $1 : $varname; + my $varbase = varname_base($varname); + my $varcanon = varname_canon($varname); checkline_mk_vardef($line, $varname, $op); @@ -3947,10 +3949,18 @@ sub checkline_mk_varassign($$$$$) { # If the variable is not used and is untyped, it may be a # spelling mistake. - if (defined($varuse) && !exists($varuse->{$varname}) && !exists($varuse->{varname_canon($varname)})) { - my $vt = get_vartypes_map(); - if (!exists($vt->{$varname}) && !exists($vt->{varname_canon($varname)})) { - $line->log_warning("${varname} is defined, but not used. Spelling mistake?"); + if (defined($varuse)) { + my $vartypes = get_vartypes_map(); + my $deprecated = get_deprecated_map(); + + if (exists($varuse->{$varname}) || exists($varuse->{$varcanon})) { + # Ok + } elsif (exists($vartypes->{$varname}) || exists($vartypes->{$varcanon})) { + # Ok + } elsif (exists($deprecated->{$varname}) || exists($deprecated->{$varcanon})) { + # Ok + } else { + $line->log_warning("${varname} is defined but not used. Spelling mistake?"); } } @@ -3986,6 +3996,8 @@ sub checkline_mk_varassign($$$$$) { if (exists(get_deprecated_map()->{$varname})) { $line->log_warning("Definition of ${varname} is deprecated. ".get_deprecated_map()->{$varname}); + } elsif (exists(get_deprecated_map()->{$varcanon})) { + $line->log_warning("Definition of ${varname} is deprecated. ".get_deprecated_map()->{$varcanon}); } if ($varname =~ qr"^SITES_") { |