pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint Added a command line option to disabl...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d92b021a41c0
branches:  trunk
changeset: 493793:d92b021a41c0
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun May 15 02:38:56 2005 +0000

description:
Added a command line option to disable warnings on unsorted things like
PLISTs and SUBDIRs in category Makefiles. The default behavior is
unchanged. Updated the man pages. Bumped PKGREVISION.

diffstat:

 pkgtools/pkglint/Makefile         |   4 ++--
 pkgtools/pkglint/files/pkglint.0  |  10 ++++++----
 pkgtools/pkglint/files/pkglint.1  |  13 ++++++++-----
 pkgtools/pkglint/files/pkglint.pl |  14 ++++++++------
 4 files changed, 24 insertions(+), 17 deletions(-)

diffs (124 lines):

diff -r 48589cc353b3 -r d92b021a41c0 pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Sun May 15 02:01:58 2005 +0000
+++ b/pkgtools/pkglint/Makefile Sun May 15 02:38:56 2005 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.234 2005/05/10 00:07:53 rillig Exp $
+# $NetBSD: Makefile,v 1.235 2005/05/15 02:38:56 rillig Exp $
 #
 
-DISTNAME=      pkglint-4.13
+DISTNAME=      pkglint-4.14
 CATEGORIES=    pkgtools devel
 MASTER_SITES=  # empty
 DISTFILES=     # empty
diff -r 48589cc353b3 -r d92b021a41c0 pkgtools/pkglint/files/pkglint.0
--- a/pkgtools/pkglint/files/pkglint.0  Sun May 15 02:01:58 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.0  Sun May 15 02:38:56 2005 +0000
@@ -90,9 +90,11 @@
      [no-]paren  Warn if variables are used like $(VAR) in Makefiles.  They
                  should always be used like ${VAR}.
 
-     [no-]patches
-                 Warn if a patch file patches more than one file or if the
-                 patches differ from what is recorded in the distinfo file.
+     [no-]sort   Warn if items of a list are not correctly sorted.  Currently
+                 this affects PLISTs and the SUBDIRs in category Makefiles.
+
+     [no-]types  Warn for some Makefile variables if their assigned values do
+                 not match their type.
 
      [no-]workdir
                  Warn about existing _w_o_r_k_* directories.  They might be commit-
@@ -141,4 +143,4 @@
      ings concerning Makefiles do not print the file and line number where the
      warning originated.
 
-                               October 16, 2004                              3
+                                 May 15, 2005                                3
diff -r 48589cc353b3 -r d92b021a41c0 pkgtools/pkglint/files/pkglint.1
--- a/pkgtools/pkglint/files/pkglint.1  Sun May 15 02:01:58 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.1  Sun May 15 02:38:56 2005 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: pkglint.1,v 1.10 2005/05/10 19:04:53 rillig Exp $
+.\"    $NetBSD: pkglint.1,v 1.11 2005/05/15 02:38:56 rillig Exp $
 .\"    From FreeBSD: portlint.1,v 1.8 1997/11/25 14:53:14 itojun Exp
 .\"
 .\" Copyright (c) 1997 by Jun-ichiro Itoh <itojun%itojun.org@localhost>.
@@ -6,7 +6,7 @@
 .\"
 .\" Roland Illig <roland.illig%gmx.de@localhost>, 2004.
 .\"
-.Dd October 16, 2004
+.Dd May 15, 2005
 .Dt PKGLINT 1
 .Sh NAME
 .Nm pkglint
@@ -110,9 +110,12 @@
 .It [no-]paren
 Warn if variables are used like $(VAR) in Makefiles.
 They should always be used like ${VAR}.
-.It [no-]patches
-Warn if a patch file patches more than one file or if the patches differ
-from what is recorded in the distinfo file.
+.It [no-]sort
+Warn if items of a list are not correctly sorted.
+Currently this affects PLISTs and the SUBDIRs in category Makefiles.
+.It [no-]types
+Warn for some Makefile variables if their assigned values do not match
+their type.
 .It [no-]workdir
 Warn about existing
 .Pa work*
diff -r 48589cc353b3 -r d92b021a41c0 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Sun May 15 02:01:58 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Sun May 15 02:38:56 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.146 2005/05/10 19:04:53 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.147 2005/05/15 02:38:56 rillig Exp $
 #
 # This version contains lots of changes necessary for NetBSD packages
 # done by Hubert Feyrer <hubertf%netbsd.org@localhost>,
@@ -279,17 +279,19 @@
        "newpkg"        => [\$opt_check_newpkg, "special checks for uncommitted packages"],
 );
 
-my $opt_warn_exec      = true;
 my $opt_warn_absname   = true;
 my $opt_warn_directcmd = true;
+my $opt_warn_exec      = true;
 my $opt_warn_paren     = true;
-my $opt_warn_workdir   = true;
+my $opt_warn_sort      = true;
 my $opt_warn_types     = true;
+my $opt_warn_workdir   = true;
 my (%warnings) = (
-       "exec"          => [\$opt_warn_exec, "warn if source files are executable"],
        "absname"       => [\$opt_warn_absname, "warn about use of absolute file names"],
        "directcmd"     => [\$opt_warn_directcmd, "warn about use of direct command names instead of Make variables"],
+       "exec"          => [\$opt_warn_exec, "warn if source files are executable"],
        "paren"         => [\$opt_warn_paren, "warn about use of \$(VAR) instead of \${VAR} in Makefiles"],
+       "sort"          => [\$opt_warn_sort, "warn about any unsorted things"],
        "types"         => [\$opt_warn_types, "do some simple type checking in Makefiles"],
        "workdir"       => [\$opt_warn_workdir, "warn that work* should not be committed into CVS"],
 );
@@ -876,7 +878,7 @@
                        $line->log_error("use of full pathname disallowed.");
                }
 
-               if ($line->text =~ qr"^\w") {
+               if ($opt_warn_sort && $line->text =~ qr"^\w") {
                        if (defined($last_file_seen)) {
                                if ($last_file_seen gt $line->text) {
                                        $line->log_warning( $line->text." should be sorted before ${last_file_seen}.");
@@ -2094,7 +2096,7 @@
                                        $line->log_error("SUBDIR+= expected.");
                                }
                                push(@makefile_subdirs, $subdir);
-                               if ($last_subdir ge $subdir) {
+                               if ($opt_warn_sort && $last_subdir ge $subdir) {
                                        $line->log_error("$subdir should come before $last_subdir.");
                                }
                                $last_subdir = $subdir;



Home | Main Index | Thread Index | Old Index