pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint Updated pkglint to 4.36.1.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5ebd0fa65dd9
branches:  trunk
changeset: 502421:5ebd0fa65dd9
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Fri Nov 04 17:00:58 2005 +0000

description:
Updated pkglint to 4.36.1.

- Added many of the variables found in pkgsrc/mk/* to makevars.map.
- Added the function log_fatal, whose output goes to stderr instead of
  stdout.
- All files in pkgsrc/mk/ are excluded from checking, as they may use
  private variables and do other questionable things.
- Removed the Language type, as it is a simple enumeration.
- Added the Userdefined type to distinguish user-definable and read-only
  variables.

diffstat:

 pkgtools/pkglint/Makefile           |   4 +-
 pkgtools/pkglint/files/makevars.map |  90 +++++++++++++++++++++++++++++++++++-
 pkgtools/pkglint/files/pkglint.pl   |  55 ++++++++++++----------
 3 files changed, 118 insertions(+), 31 deletions(-)

diffs (truncated from 327 to 300 lines):

diff -r 94919a68529c -r 5ebd0fa65dd9 pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Fri Nov 04 16:53:24 2005 +0000
+++ b/pkgtools/pkglint/Makefile Fri Nov 04 17:00:58 2005 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.281 2005/11/04 13:57:35 rillig Exp $
+# $NetBSD: Makefile,v 1.282 2005/11/04 17:00:58 rillig Exp $
 #
 
-DISTNAME=      pkglint-4.36
+DISTNAME=      pkglint-4.36.1
 CATEGORIES=    pkgtools devel
 MASTER_SITES=  # empty
 DISTFILES=     # empty
diff -r 94919a68529c -r 5ebd0fa65dd9 pkgtools/pkglint/files/makevars.map
--- a/pkgtools/pkglint/files/makevars.map       Fri Nov 04 16:53:24 2005 +0000
+++ b/pkgtools/pkglint/files/makevars.map       Fri Nov 04 17:00:58 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: makevars.map,v 1.24 2005/11/04 13:57:35 rillig Exp $
+# $NetBSD: makevars.map,v 1.25 2005/11/04 17:00:58 rillig Exp $
 #
 
 # This file contains the guessed type of some variables, according to
@@ -42,49 +42,131 @@
 
 # some other variables, sorted alphabetically
 
+ALTERNATIVES_FILE      Filename
+BDB185_DEFAULT         Userdefined
+BDBBASE                        Readonly
+BDB_ACCEPTED           List* of { db1 db2 db3 db4 }
+BDB_DEFAULT            Userdefined
+BDB_LIBS               Readonly
+BDB_TYPE               Readonly
+BUILDLINK_DEPENDS      List*
+BUILDLINK_TRANSFORM    List
 BUILD_DEFS             List of Varname
 BUILD_DEPENDS          List of Dependency
 BUILD_DIRS             List* of WrksrcSubdirectory
 BUILD_USES_MSGFMT      Yes
+BUILTIN_X11_TYPE       Readonly
+BUILTIN_X11_VERSION    Readonly
 CATEGORIES             List* of Category
+CC_VERSION             Readonly
 CFLAGS                 List
 CONFIGURE_ARGS         List
 CONFIGURE_DIRS         List* of WrksrcSubdirectory
 CONFIGURE_ENV          List
 CPPFLAGS               List
 DEPENDS                        List of Dependency
+DISTFILES              List* of Filename
 DISTNAME               Filename
-DISTFILES              List* of Filename
+EMACS_BIN              Readonly
+EMACS_ETCPREFIX                Readonly
+EMACS_FLAVOR           Readonly
+EMACS_INFOPREFIX       Readonly
+EMACS_LISPPREFIX       Readonly
+EMACS_PKGNAME_PREFIX   Readonly
+EMACS_TYPE             Userdefined
+EMACS_USE_LEIM         Yes
+EMACS_VERSIONS_ACCEPTED        List* of { emacs21 emacs21nox emacs20 xemacs215 xemacs214 }
+EXTRACT_ELEMENTS       List* of Pathmask
+EXTRACT_ONLY           List* of Pathname
+EXTRACT_USING          { gtar nbtar pax }
+FAMBASE                        Readonly
+FAM_ACCEPTED           List* of { fam gamin }
+FAM_DEFAULT            Userdefined
+FAM_TYPE               Readonly
+FILES_SUBST            List
+GCC_REQD               List
 GNU_CONFIGURE          Yes
 HOMEPAGE               URL
 INSTALL_DIRS           List* of WrksrcSubdirectory
-LANGUAGES              List* of Language
+INSTALL_UNSTRIPPED     YesNo
+KRB5BASE               Readonly
+KRB5_ACCEPTED          List* of { heimdal mit-krb5 }
+KRB5_DEFAULT           Userdefined
+KRB5_TYPE              Readonly
 LDFLAGS                        List
 LIBS                   List
 MAINTAINER             Mail_Address
+MAKEFLAGS              List
+MAKEVARS               List of Varname
 MAKE_ENV               List
 MAKE_FLAGS             List
 MANZ                   Yes
 MASTER_SITES           List* of URL
+MYSQL_VERSIONS_ACCEPTED        List* of { 40 41 50 }
+MYSQL_VERSION_DEFAULT  Userdefined
 NO_BUILD               Yes
 NO_CHECKSUM            Yes
 NO_CONFIGURE           Yes
 NO_MTREE               Yes
 NO_PKGTOOLS_REQD_CHECK Yes
 NO_PKG_REGISTER                Yes
+PAMBASE                        Readonly
+PAM_ACCEPTED           List* of { linux-pam openpam solaris-pam }
+PAM_DEFAULT            Userdefined
+PAM_TYPE               Readonly
+PGSQL_VERSIONS_ACCEPTED        List* of { 73 74 80 }
+PGSQL_VERSION_DEFAULT  Userdefined
 PKGBASE                        Readonly
+PKGNAME_NOREV          Readonly
+PKGREPOSITORY          Userdefined
+PKGREPOSITORY          Userdefined
 PKGREVISION            PkgRevision
+PKGSRC_COMPILER                Userdefined
 PKGVERSION             Readonly
+PKGWILDCARD            Readonly
+PKG_APACHE             Readonly
+PKG_APACHE_ACCEPTED    List* of { apache13 apache2 }
+PKG_APACHE_DEFAULT     Userdefined
+PKG_DEBUG_LEVEL                Userdefined
+PKG_DEFAULT_OPTIONS    Userdefined
+PKG_FAIL_REASON                List
+PKG_JAVA_HOME          Readonly
+PKG_JVM                        Readonly
+PKG_JVMS_ACCEPTED      List* of { blackdown-jdk13 jdk jdk14 kaffe sun-jdk13 sun-jdk14 sun-jdk15 }
+PKG_JVM_DEFAULT                Userdefined
+PKG_LEGACY_OPTIONS     List* of Option
+PKG_OPTIONS            Readonly
+PKG_OPTIONS_DEPRECATED_WARNINGS        List*
+PKG_OPTIONS_LEGACY_OPTS        List*
+PKG_OPTIONS_LEGACY_VARS        List*
+PKG_OPTIONS_NONEMPTY_SETS      List*
+PKG_OPTIONS_OPTIONAL_GROUPS    List*
+PKG_OPTIONS_REQUIRED_GROUPS    List*
+PKG_OPTIONS_VAR                Varname
 PKG_PRESERVE           Yes
+PKG_SKIP_REASON                List
+PKG_SUFX               Userdefined
 PKG_SUGGESTED_OPTIONS  List* of Option
 PKG_SUPPORTED_OPTIONS  List* of Option
+PLIST_SRC              List of Pathname
 PLIST_SUBST            List
-PTHREAD_OPTS           List of { require native }
+PLIST_TYPE             { dynamic static }
+PTHREAD_AUTO_VARS      YesNo
+PTHREAD_OPTS           List of { native optional require }
+PTHREAD_TYPE           Readonly
+REPLACE_EMACS          List of Pathname
 SUBST_CLASSES          List
 SUBST_FILES            List* of Pathmask
 SUBST_SED              List*
 SUBST_STAGE            Stage
+USE_JAVA               { run yes }
+USE_JAVA2              { yes 1.4 1.5 }
+USE_LANGUAGES          List* of { c c++ fortran java objc }
 USE_LIBTOOL            Yes
+USE_PKGINSTALL         Yes
 USE_PKGLOCALEDIR       YesNo
+USE_PKGSRC_GCC         Userdefined
 USE_TOOLS              List of Tool
 USE_X11                        Yes
+X11_PKGSRCDIR          Readonly
+X11_TYPE               Userdefined
diff -r 94919a68529c -r 5ebd0fa65dd9 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Fri Nov 04 16:53:24 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Fri Nov 04 17:00:58 2005 +0000
@@ -11,7 +11,7 @@
 # Freely redistributable.  Absolutely no warranty.
 #
 # From Id: portlint.pl,v 1.64 1998/02/28 02:34:05 itojun Exp
-# $NetBSD: pkglint.pl,v 1.327 2005/11/04 13:57:35 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.328 2005/11/04 17:00:58 rillig Exp $
 #
 # This version contains lots of changes necessary for NetBSD packages
 # done by:
@@ -110,8 +110,8 @@
 my $verbose_flag       = false;
 my $gcc_output_format  = false;
 
-sub log_message($$$$$) {
-       my ($file, $subr, $lineno, $type, $message) = @_;
+sub log_message($$$$$$) {
+       my ($out, $file, $subr, $lineno, $type, $message) = @_;
        my ($text, $sep);
 
        if (defined($file)) {
@@ -150,33 +150,39 @@
                $sep = "";
        }
 
-       print("${text}\n");
+       print $out ("${text}\n");
+}
+
+sub log_fatal($$$) {
+       my ($file, $lineno, $msg) = @_;
+       log_message(*STDERR, $file, undef, $lineno, $gcc_output_format ? "fatal" : "FATAL", $msg);
+       exit(1);
 }
 
 sub log_error($$$) {
        my ($file, $lineno, $msg) = @_;
-       log_message($file, undef, $lineno, $gcc_output_format ? "error" : "ERROR", $msg);
+       log_message(*STDOUT, $file, undef, $lineno, $gcc_output_format ? "error" : "ERROR", $msg);
        $errors++;
 }
 sub log_warning($$$) {
        my ($file, $lineno, $msg) = @_;
-       log_message($file, undef, $lineno, $gcc_output_format ? "warning" : "WARN", $msg);
+       log_message(*STDOUT, $file, undef, $lineno, $gcc_output_format ? "warning" : "WARN", $msg);
        $warnings++;
 }
 sub log_note($$$) {
        my ($file, $lineno, $msg) = @_;
-       log_message($file, undef, $lineno, $gcc_output_format ? "note" : "NOTE", $msg);
+       log_message(*STDOUT, $file, undef, $lineno, $gcc_output_format ? "note" : "NOTE", $msg);
 }
 sub log_info($$$) {
        my ($file, $lineno, $msg) = @_;
        if ($verbose_flag) {
-               log_message($file, undef, $lineno, $gcc_output_format ? "info" : "OK", $msg);
+               log_message(*STDOUT, $file, undef, $lineno, $gcc_output_format ? "info" : "OK", $msg);
        }
 }
 sub log_subinfo($$$$) {
        my ($subr, $file, $lineno, $msg) = @_;
        if ($verbose_flag) {
-               log_message($file, $subr, $lineno, $gcc_output_format ? "info" : "OK", $msg);
+               log_message(*STDOUT, $file, $subr, $lineno, $gcc_output_format ? "info" : "OK", $msg);
        }
 }
 
@@ -246,6 +252,10 @@
        return shift(@_)->[CHANGED];
 }
 
+sub log_fatal($$) {
+       my ($self, $text) = @_;
+       PkgLint::Logging::log_fatal($self->[FILE], $self->[LINES], $text);
+}
 sub log_error($$) {
        my ($self, $text) = @_;
        PkgLint::Logging::log_error($self->[FILE], $self->[LINES], $text);
@@ -712,11 +722,11 @@
                if ($line->text =~ qr"^(?:#.*|\s*)$") {
                        # ignore empty and comment lines
 
-               } elsif ($line->text =~ qr"^([\w\d_.]+)\s+([\w_* {}]+)$") {
+               } elsif ($line->text =~ qr"^([\w\d_.]+)\s+([-.+\w\d_* \{\}]+)$") {
                        $vartypes->{$1} = $2;
 
                } else {
-                       $line->log_error("[internal] Unknown line format.");
+                       $line->log_fatal("Unknown line format.");
                }
        }
        return $vartypes;
@@ -733,7 +743,7 @@
        my ($names) = {};
 
        if (!$lines) {
-               log_error($fname, NO_LINE_NUMBER, "[internal] Could not be read.");
+               log_error($fname, NO_LINE_NUMBER, "Could not be read.");
                $load_dist_sites_url2name = $url2name;
                $load_dist_sites_names = $names;
                return;
@@ -1319,10 +1329,7 @@
                            || ($includefile =~ qr"^(?:\.\./(?:\.\./[^/]+/)?[^/]+/)?([^/]+)$" && $1 ne "buildlink3.mk")) {
                                $seen_Makefile_common = true;
                        }
-                       if ($includefile =~ /\/mk\/texinfo\.mk/) {
-                               $line->log_error("Do not include $includefile.");
-                       }
-                       if ($includefile =~ /\/mk\/(?:bsd|java)/) {
+                       if ($includefile =~ qr"/mk/") {
                                # skip these files
                                $contents .= $text . "\n";
                        } else {
@@ -1430,7 +1437,7 @@
        my $lines = load_lines($fname, true);
        my $tools = {};
        if (!$lines) {
-               log_error($fname, NO_LINE_NUMBER, "[internal] Cannot be read.");
+               log_fatal($fname, NO_LINE_NUMBER, "Cannot be read.");
        } else {
                foreach my $line (@{$lines}) {
                        if ($line->text =~ regex_varassign) {
@@ -1527,11 +1534,6 @@
                        $line->log_warning("\"${value}\" is not a valid filename mask.");
                }
 
-       } elsif ($type eq "Language") {
-               if ($value !~ qr"^(?:c|c\+\+|fortran)$") {
-                       $line->log_warning("\"${value}\" is not a valid language.");
-               }
-
        } elsif ($type eq "Mail_Address") {
                if ($value !~ qr"^[-\w\d_.]+\@[-\w\d.]+$") {
                        $line->log_warning("\"${value}\" is not a valid mail address.");
@@ -1611,11 +1613,14 @@
                        $line->log_warning("\"${value}\" is not a valid URL.");
                }
 
+       } elsif ($type eq "Userdefined") {
+               $line->log_error("\"${varname}\" may only be set by the user, not the package.");
+



Home | Main Index | Thread Index | Old Index