pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files Restricted the warning option -...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/65ac598df0dc
branches:  trunk
changeset: 496561:65ac598df0dc
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Jul 02 14:46:06 2005 +0000

description:
Restricted the warning option -Wsort to only apply to PLIST files and
therefore renamed it to -Wplist-sort. This option is disabled by default
to avoid excessive warnings. Apart from an unfounded suggestion
somewhere in the past, I don't see a reason why PLIST files should be
sorted. Remember: The option is still available, it's just disabled by
default.

diffstat:

 pkgtools/pkglint/files/pkglint.0  |   7 ++++---
 pkgtools/pkglint/files/pkglint.1  |  10 +++++-----
 pkgtools/pkglint/files/pkglint.pl |  10 +++++-----
 3 files changed, 14 insertions(+), 13 deletions(-)

diffs (100 lines):

diff -r 75747777d87b -r 65ac598df0dc pkgtools/pkglint/files/pkglint.0
--- a/pkgtools/pkglint/files/pkglint.0  Sat Jul 02 14:31:11 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.0  Sat Jul 02 14:46:06 2005 +0000
@@ -84,8 +84,9 @@
      [no-]paren  Warn if variables are used like $(VAR) in Makefiles.  They
                  should always be used like ${VAR}.
 
-     [no-]sort   Warn if items of a list are not correctly sorted.  Currently
-                 this affects PLISTs and the SUBDIRs in category Makefiles.
+     [no-]plist-sort
+                 Warn if items of a PLIST file are not sorted alphabetically.
+                 This warning is disabled by default.
 
      [no-]types  Warn for some Makefile variables if their assigned values do
                  not match their type.
@@ -137,4 +138,4 @@
      ings concerning Makefiles do not print the file and line number where the
      warning originated.
 
-                                 May 23, 2005                                3
+                                 Jul 02, 2005                                3
diff -r 75747777d87b -r 65ac598df0dc pkgtools/pkglint/files/pkglint.1
--- a/pkgtools/pkglint/files/pkglint.1  Sat Jul 02 14:31:11 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.1  Sat Jul 02 14:46:06 2005 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: pkglint.1,v 1.13 2005/05/31 20:44:02 rillig Exp $
+.\"    $NetBSD: pkglint.1,v 1.14 2005/07/02 14:46:06 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 May 23, 2005
+.Dd Jul 02, 2005
 .Dt PKGLINT 1
 .Sh NAME
 .Nm pkglint
@@ -101,9 +101,9 @@
 .It [no-]paren
 Warn if variables are used like $(VAR) in Makefiles.
 They should always be used like ${VAR}.
-.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-]plist-sort
+Warn if items of a PLIST file are not sorted alphabetically.
+This warning is disabled by default.
 .It [no-]types
 Warn for some Makefile variables if their assigned values do not match
 their type.
diff -r 75747777d87b -r 65ac598df0dc pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Sat Jul 02 14:31:11 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Sat Jul 02 14:46:06 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.197 2005/07/02 12:02:58 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.198 2005/07/02 14:46:06 rillig Exp $
 #
 # This version contains lots of changes necessary for NetBSD packages
 # done by:
@@ -317,7 +317,7 @@
 my $opt_warn_exec      = true;
 my $opt_warn_order     = true;
 my $opt_warn_paren     = true;
-my $opt_warn_sort      = true;
+my $opt_warn_plist_sort        = false;
 my $opt_warn_types     = true;
 my $opt_warn_vague     = true;
 my $opt_warn_workdir   = true;
@@ -327,7 +327,7 @@
        "exec"          => [\$opt_warn_exec, "warn if source files are executable"],
        "order"         => [\$opt_warn_order, "warn if Makefile entries are unordered"],
        "paren"         => [\$opt_warn_paren, "warn about use of \$(VAR) instead of \${VAR} in Makefiles"],
-       "sort"          => [\$opt_warn_sort, "warn about any unsorted entries in category Makefiles and PLISTs"],
+       "plist-sort"    => [\$opt_warn_plist_sort, "warn about unsorted entries in PLISTs"],
        "types"         => [\$opt_warn_types, "do some simple type checking in Makefiles"],
        "vague"         => [\$opt_warn_vague, "show old (unreliable, vague) warnings"],
        "workdir"       => [\$opt_warn_workdir, "warn that work* should not be committed into CVS"],
@@ -927,7 +927,7 @@
                        $line->log_error("Use of full pathname disallowed.");
                }
 
-               if ($opt_warn_sort && $line->text =~ qr"^\w") {
+               if ($opt_warn_plist_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}.");
@@ -2056,7 +2056,7 @@
                                        $line->log_error("SUBDIR+= expected.");
                                }
                                push(@makefile_subdirs, $subdir);
-                               if ($opt_warn_sort && $last_subdir ge $subdir) {
+                               if ($last_subdir ge $subdir) {
                                        $line->log_error("$subdir should come before $last_subdir.");
                                }
                                $last_subdir = $subdir;



Home | Main Index | Thread Index | Old Index