pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files - _FETCH_MESSAGE, BUILDLINK_REC...
details: https://anonhg.NetBSD.org/pkgsrc/rev/ff3a688963d4
branches: trunk
changeset: 513259:ff3a688963d4
user: rillig <rillig%pkgsrc.org@localhost>
date: Tue May 23 08:59:47 2006 +0000
description:
- _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:
pkgtools/pkglint/files/deprecated.map | 6 ++++--
pkgtools/pkglint/files/makevars.map | 5 +++--
pkgtools/pkglint/files/pkglint.pl | 26 +++++++++++++++++++-------
3 files changed, 26 insertions(+), 11 deletions(-)
diffs (114 lines):
diff -r 67a585ade2a4 -r ff3a688963d4 pkgtools/pkglint/files/deprecated.map
--- a/pkgtools/pkglint/files/deprecated.map Tue May 23 08:39:16 2006 +0000
+++ b/pkgtools/pkglint/files/deprecated.map Tue May 23 08:59:47 2006 +0000
@@ -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_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 @@
# 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 -r 67a585ade2a4 -r ff3a688963d4 pkgtools/pkglint/files/makevars.map
--- a/pkgtools/pkglint/files/makevars.map Tue May 23 08:39:16 2006 +0000
+++ b/pkgtools/pkglint/files/makevars.map Tue May 23 08:59:47 2006 +0000
@@ -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_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_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 -r 67a585ade2a4 -r ff3a688963d4 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Tue May 23 08:39:16 2006 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Tue May 23 08:59:47 2006 +0000
@@ -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 @@
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_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 @@
# 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 @@
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_") {
Home |
Main Index |
Thread Index |
Old Index