summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrillig <rillig>2006-03-11 18:38:35 +0000
committerrillig <rillig>2006-03-11 18:38:35 +0000
commit78650fa0160067b9bbd8ff7ea99810dbe0fa8a8b (patch)
tree723f961fbf893da47fedbb83d4b71785e06776ef
parent3e8e6c6ad951481372702a58ec405ffbbb155ec0 (diff)
downloadpkgsrc-78650fa0160067b9bbd8ff7ea99810dbe0fa8a8b.tar.gz
- Renamed "List!" to "InternalList".
- When ${SED} and ${MV} are used in a single shell command, print a note that the SUBST framework is preferred over the direct use of these commands.
-rw-r--r--pkgtools/pkglint/files/makevars.map28
-rw-r--r--pkgtools/pkglint/files/pkglint.pl12
2 files changed, 24 insertions, 16 deletions
diff --git a/pkgtools/pkglint/files/makevars.map b/pkgtools/pkglint/files/makevars.map
index 8648b8fa602..fca923c9a22 100644
--- a/pkgtools/pkglint/files/makevars.map
+++ b/pkgtools/pkglint/files/makevars.map
@@ -1,4 +1,4 @@
-# $NetBSD: makevars.map,v 1.73 2006/03/11 00:01:28 rillig Exp $
+# $NetBSD: makevars.map,v 1.74 2006/03/11 18:38:35 rillig Exp $
#
# This file contains the guessed type of some variables, according to
@@ -10,11 +10,12 @@
# The type Yes is used for variables that are checked using
# .if defined(VAR)
#
-# Type type List is used for lists of things. There are two modifiers
-# for lists: The "+" means that this variable should only be initialized
-# to the empty list or have some values appended using the "+=" operator.
-# The "!" means that the list is an internal list. See the pkgsrc guide,
-# chapter "Makefiles" for a detailed explanation.
+# Type type List is used for lists of things. There are two types of lists,
+# InternalList and List, which are described in the pkgsrc guide, chapter
+# "Makefiles". When a "+" is appended to the List keyword, it means that
+# this variable should only be initialized to the empty list or have some
+# values appended using the "+=" operator. All other operations will
+# generate a warning.
# some variables from mk/defaults/mk.conf, 1.27
@@ -53,7 +54,7 @@ BUILDLINK_CONTENTS_FILTER List of ShellWord
# ^^ ShellCommand
BUILDLINK_CFLAGS List+ of CFlag
BUILDLINK_CPPFLAGS List+ of CFlag
-BUILDLINK_DEPENDS List!+ of Dependency
+BUILDLINK_DEPENDS InternalList+ of Dependency
BUILDLINK_DEPMETHOD BuildlinkDepmethod
BUILDLINK_DEPTH BuildlinkDepth
BUILDLINK_FILES List+ of Pathmask
@@ -70,12 +71,12 @@ BUILDLINK_PASSTHRU_DIRS List+ of Pathname
BUILDLINK_PASSTHRU_RPATHDIRS List+ of Pathname
BUILDLINK_PKGSRCDIR RelativePkgDir
BUILDLINK_PREFIX Pathname
-BUILDLINK_RECOMMENDED List!+ of Dependency
+BUILDLINK_RECOMMENDED InternalList+ of Dependency
BUILDLINK_RPATHDIRS List of Pathname
BUILDLINK_TARGETS List+ of Identifier
BUILDLINK_TRANSFORM List+
BUILD_DEFS List+ of Varname
-BUILD_DEPENDS List!+ of DependencyWithPath
+BUILD_DEPENDS InternalList+ of DependencyWithPath
BUILD_DIRS List of WrksrcSubdirectory
BUILD_ENV List+ of ShellWord
BUILD_TARGET List of Identifier
@@ -117,7 +118,8 @@ CXX Readonly
CXXFLAGS List+ of CFlag
DEINSTALL_FILE Pathname
DEINSTALL_EXTRA_TMPL List+ of Pathname
-DEPENDS List!+ of DependencyWithPath
+DEINSTALL_SRC List of Pathname
+DEPENDS InternalList+ of DependencyWithPath
DESCR_SRC List of Pathname
DEVOSSAUDIO Pathname
DEVOSSSOUND Pathname
@@ -149,7 +151,8 @@ 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
+EVAL_PREFIX InternalList of ShellWord
+# ^^ FIXME: Looks like a type mismatch.
EXTRACT_CMD List of ShellWord
EXTRACT_ELEMENTS List of Pathmask
EXTRACT_ONLY List of Pathname
@@ -204,6 +207,7 @@ INSTALL_PROGRAM_DIR ShellCommand
INSTALL_SCRIPT ShellCommand
INSTALL_SCRIPTS_ENV List+ of ShellWord
INSTALL_SCRIPT_DIR ShellCommand
+INSTALL_SRC List of Pathname
INSTALL_TARGET List of Identifier
INSTALL_UNSTRIPPED YesNo
INTERACTIVE_STAGE List of { fetch extract configure build install }
@@ -211,7 +215,7 @@ IS_BUILTIN YesNoFromCommand
JAVA_CLASSPATH ShellWord
JAVA_NAME Filename
JAVA_UNLIMIT List+ of { cmdsize datasize stacksize }
-JAVA_WRAPPERS List!+ of Filename
+JAVA_WRAPPERS InternalList+ of Filename
KRB5BASE Readonly
KRB5_ACCEPTED List of { heimdal mit-krb5 }
KRB5_DEFAULT Userdefined
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index ef754f2ff30..29cda00bf3b 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -1,5 +1,5 @@
#! @PERL@
-# $NetBSD: pkglint.pl,v 1.546 2006/03/10 22:30:25 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.547 2006/03/11 18:38:35 rillig Exp $
#
# pkglint - static analyzer and checker for pkgsrc packages
@@ -2062,7 +2062,7 @@ sub shell_split($) {
sub type_should_be_quoted($) {
my ($type) = @_;
- return !($type =~ qr"^(?:List(?:$|[^!]).*|ShellCommand|SedCommands)$");
+ return !($type =~ qr"^(?:List.*|ShellCommand|SedCommands)$");
}
my $check_pkglint_version_done = false;
@@ -2699,6 +2699,10 @@ sub checkline_mk_shelltext($$) {
truss
));
+ if ($text =~ qr"\$\{SED\}" && $text =~ qr"\$\{MV\}") {
+ $line->log_note("Please use the SUBST framework instead of \${SED} and \${MV}.");
+ }
+
if ($text =~ qr"^\@*-(.*(MKDIR|INSTALL.*-d|INSTALL_.*_DIR).*)") {
my ($mkdir_cmd) = ($1);
@@ -3441,8 +3445,8 @@ sub checkline_mk_vartype($$$$$) {
} elsif ($op eq "!=") {
$opt_debug and $line->log_info("Use of !=: ${value}");
- } elsif ($type =~ qr"^List(!?)(\+?)(?: of (.*))?$") {
- my ($internal_list, $append_only, $element_type) = ($1 eq "!", $2 eq "+", $3);
+ } elsif ($type =~ qr"^(InternalList|List)(\+?)(?: of (.*))?$") {
+ my ($internal_list, $append_only, $element_type) = ($1 eq "InternalList", $2 eq "+", $3);
my (@words, $rest);
if ($append_only && $op ne "+=" && $op ne "?=" && !($value eq "" && defined($comment) && $comment =~ qr"^#")) {