diff options
author | rillig <rillig@pkgsrc.org> | 2006-02-15 16:10:49 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2006-02-15 16:10:49 +0000 |
commit | 06027718980c664cf163be3d841dedf363996051 (patch) | |
tree | 33f8b412a117e08533953472b1606eb69328bb90 /pkgtools | |
parent | 63486979047302252289e127791feb8c3b53d62c (diff) | |
download | pkgsrc-06027718980c664cf163be3d841dedf363996051.tar.gz |
- Some more typed variables.
- Variables that are not of type "List of something" should be quoted when
used in shell programs.
- In mail addresses, a "+" is allowed.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/files/makevars.map | 8 | ||||
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 18 |
2 files changed, 20 insertions, 6 deletions
diff --git a/pkgtools/pkglint/files/makevars.map b/pkgtools/pkglint/files/makevars.map index 151fc3f521e..ebb658c3f27 100644 --- a/pkgtools/pkglint/files/makevars.map +++ b/pkgtools/pkglint/files/makevars.map @@ -1,4 +1,4 @@ -# $NetBSD: makevars.map,v 1.61 2006/02/15 11:41:01 rillig Exp $ +# $NetBSD: makevars.map,v 1.62 2006/02/15 16:10:49 rillig Exp $ # # This file contains the guessed type of some variables, according to @@ -65,6 +65,7 @@ BUILDLINK_LIBDIRS List of Pathname BUILDLINK_LIBS List of LdFlag BUILDLINK_PACKAGES BuildlinkPackages BUILDLINK_PASSTHRU_DIRS List+ of Pathname +BUILDLINK_PASSTHRU_RPATHDIRS List+ of Pathname BUILDLINK_PKGSRCDIR RelativePkgDir BUILDLINK_PREFIX Pathname BUILDLINK_RECOMMENDED List!+ of Dependency @@ -124,6 +125,7 @@ DJB_CONFIG_CMDS List of ShellWord # ^^ ShellCommand, terminated by a semicolon DJB_RESTRICTED YesNo DJB_MAKE_TARGETS List of Identifier +DJB_SLASHPACKAGE YesNo DL_AUTO_VARS Yes DL_LIBS List+ of LdFlag EMACS_BIN Readonly @@ -137,6 +139,7 @@ EMACS_USE_LEIM Yes EMACS_VERSIONS_ACCEPTED List of { emacs21 emacs21nox emacs20 xemacs215 xemacs214 } EMACS_VERSION_REQD List+ # ^^ of Version +EVAL_PREFIX List! of ShellWord EXTRACT_CMD List of ShellWord EXTRACT_ELEMENTS List of Pathmask EXTRACT_ONLY List of Pathname @@ -157,6 +160,7 @@ FAM_TYPE Readonly FETCH_BEFORE_ARGS List of ShellWord FILESDIR RelativePkgPath FILES_SUBST List+ of ShellWord +FILES_SUBST_SED List+ of ShellWord FONTS_DIRS List+ of Pathname GCC_REQD List+ GENERATE_PLIST List+ of ShellWord @@ -174,6 +178,7 @@ INFO_FILES List of Pathmask INSTALLATION_DIRS List of Pathname INSTALL_DIRS List of WrksrcSubdirectory INSTALL_EXTRA_TMPL List+ of Pathname +INSTALL_FILE Pathname INSTALL_MAKE_FLAGS List+ of ShellWord INSTALL_SCRIPTS_ENV List+ of ShellWord INSTALL_TARGET List of Identifier @@ -187,6 +192,7 @@ KRB5_TYPE Readonly LDFLAGS List+ of LdFlag LIBS List+ of LdFlag LIBTOOL_OVERRIDE List+ of Pathmask +LICENCE Identifier LICENSE Identifier LTCONFIG_OVERRIDE List+ of Pathmask MAINTAINER Mail_Address diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 4881e16c332..9f2e23a441b 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.pl,v 1.517 2006/02/15 11:41:01 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.518 2006/02/15 16:10:49 rillig Exp $ # # pkglint - static analyzer and checker for pkgsrc packages @@ -2178,7 +2178,7 @@ sub checkline_relative_pkgdir($$) { checkline_relative_path($line, $path); $path = resolve_relative_path($path, false); - if ($path !~ qr"^\.\./\.\./[^/]+/[^/]+$") { + if ($path !~ qr"^(?:\./)?\.\./\.\./[^/]+/[^/]+$") { $line->log_warning("\"${path}\" is not a valid relative package directory."); $line->explain( "A relative pathname always starts with \"../../\", followed", @@ -2297,10 +2297,18 @@ sub checkline_mk_shellword($$$) { my ($line, $shellword, $check_quoting) = @_; my ($rest, $state); - if ($shellword =~ qr"^\$\{(${regex_varname})(:.+)?\}$") { + if ($opt_warn_quoting && $shellword =~ qr"^\$\{(${regex_varname})(:.+)?\}$") { my ($varname, $mod) = ($1, $2); - $opt_debug and $line->log_warning("Not sure whether the variable ${varname} needs quoting."); + if (exists(get_vartypes_map()->{$varname}) && !(defined($mod) && $mod =~ qr":Q$")) { + my $vartype = get_vartypes_map()->{$varname}; + + if ($vartype !~ qr"^List") { + $line->log_warning("Please use \${${varname}:Q} instead of \${${varname}}."); + } + } else { + $opt_debug and $line->log_warning("Not sure whether the variable ${varname} needs quoting."); + } return; } @@ -2882,7 +2890,7 @@ sub checkline_mk_vartype_basic($$$$$$) { } } elsif ($type eq "Mail_Address") { - if ($value =~ qr"^([-\w\d_.]+)\@([-\w\d.]+)$") { + if ($value =~ qr"^([+\-.0-9A-Z_a-z]+)\@([-\w\d.]+)$") { my (undef, $domain) = ($1, $2); if ($domain =~ qr"^NetBSD.org"i && $domain ne "NetBSD.org") { $line->log_warning("Please write NetBSD.org instead of ${domain}."); |