pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files - Renamed "List!" to "InternalL...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d959d0827509
branches:  trunk
changeset: 509575:d959d0827509
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Mar 11 18:38:35 2006 +0000

description:
- 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.

diffstat:

 pkgtools/pkglint/files/makevars.map |  28 ++++++++++++++++------------
 pkgtools/pkglint/files/pkglint.pl   |  12 ++++++++----
 2 files changed, 24 insertions(+), 16 deletions(-)

diffs (129 lines):

diff -r 8c4a0ea1abb1 -r d959d0827509 pkgtools/pkglint/files/makevars.map
--- a/pkgtools/pkglint/files/makevars.map       Sat Mar 11 18:22:22 2006 +0000
+++ b/pkgtools/pkglint/files/makevars.map       Sat Mar 11 18:38:35 2006 +0000
@@ -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 @@
 # ^^ 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_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 @@
 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_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_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 @@
 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 -r 8c4a0ea1abb1 -r d959d0827509 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Sat Mar 11 18:22:22 2006 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Sat Mar 11 18:38:35 2006 +0000
@@ -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 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 @@
                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 @@
                } 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"^#")) {



Home | Main Index | Thread Index | Old Index