pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc Updated pkglint to 4.25.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c5a5378e415f
branches:  trunk
changeset: 500391:c5a5378e415f
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Fri Oct 07 17:34:11 2005 +0000

description:
Updated pkglint to 4.25.

Improved heuristics for packages that use some common Makefiles,
reducing the number of false diagnostics in -Wvague mode. Moved checks
for SVR4_PKGNAME out of -Wvague mode. Added check for misspelled
NO_{SRC,BIN}_ON_{FTP,CDROM}.

diffstat:

 doc/CHANGES                       |   3 +-
 pkgtools/pkglint/Makefile         |   4 +-
 pkgtools/pkglint/files/pkglint.pl |  40 +++++++++++++++++++++++++-------------
 3 files changed, 30 insertions(+), 17 deletions(-)

diffs (122 lines):

diff -r 1f7ea94b5e9d -r c5a5378e415f doc/CHANGES
--- a/doc/CHANGES       Fri Oct 07 17:19:03 2005 +0000
+++ b/doc/CHANGES       Fri Oct 07 17:34:11 2005 +0000
@@ -1,4 +1,4 @@
-$NetBSD: CHANGES,v 1.11365 2005/10/07 17:17:21 joerg Exp $
+$NetBSD: CHANGES,v 1.11366 2005/10/07 17:34:45 rillig Exp $
 
 Changes to the packages collection and infrastructure in 2005:
 
@@ -4322,3 +4322,4 @@
        Updated sysutils/gnome-vfs2 to 2.12.1.1 [drochner 2005-10-07]
        Updated devel/gail to 1.8.5 [drochner 2005-10-07]
        Updated archivers/dact to 0.8.3nb3 [joerg 2005-10-07]
+       Updated pkgtools/pkglint to 4.25 [rillig 2005-10-07]
diff -r 1f7ea94b5e9d -r c5a5378e415f pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Fri Oct 07 17:19:03 2005 +0000
+++ b/pkgtools/pkglint/Makefile Fri Oct 07 17:34:11 2005 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.260 2005/10/07 10:24:42 rillig Exp $
+# $NetBSD: Makefile,v 1.261 2005/10/07 17:34:11 rillig Exp $
 #
 
-DISTNAME=      pkglint-4.24
+DISTNAME=      pkglint-4.25
 CATEGORIES=    pkgtools devel
 MASTER_SITES=  # empty
 DISTFILES=     # empty
diff -r 1f7ea94b5e9d -r c5a5378e415f pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Fri Oct 07 17:19:03 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Fri Oct 07 17:34:11 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.294 2005/10/07 10:24:43 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.295 2005/10/07 17:34:11 rillig Exp $
 #
 # This version contains lots of changes necessary for NetBSD packages
 # done by:
@@ -1147,8 +1147,14 @@
                        }
 
                        $seen_Makefile_include->{$includefile} = true;
-                       if ($includefile =~ qr"Makefile\.common$") {
-                               $seen_Makefile_common = true;
+                       if ($includefile =~ qr"^\.\./[^./][^/]*/[^/]+") {
+                               $line->log_warning("Relative directories should look like \"../../cat/pkg\", not \"../pkg\".");
+                       }
+                       if ($includefile =~ qr"^(?:\.\./(?:\.\./[^/]+/)?[^/]+/)?([^/]+)$") {
+                               my ($basename) = ($1);
+                               if ($basename ne "buildlink3.mk") {
+                                       $seen_Makefile_common = true;
+                               }
                        }
                        if ($includefile =~ /\/mk\/texinfo\.mk/) {
                                $line->log_error("Do not include $includefile.");
@@ -1514,9 +1520,24 @@
                                }
                        }
 
+                       if ($varname eq "SVR4_PKGNAME") {
+                               if ($value =~ $regex_unresolved) {
+                                       $line->log_error("SVR4_PKGNAME must not contain references to other variables.");
+                               } elsif (length($value) > 5) {
+                                       $line->log_error("SVR4_PKGNAME must not be longer than 5 characters.");
+                               }
+                       }
+
                        if ($value eq "# defined" && $varname !~ qr".*(?:_MK|_COMMON)$") {
                                $line->log_warning("Please use \"# empty\", \"# none\" or \"yes\" instead of \"# defined\".");
                        }
+
+                       if ($varname =~ qr"^NO_(.*)_ON_(.*)$") {
+                               my ($what, $where) = ($1, $2);
+                               if (($what ne "SRC" && $what ne "BIN") || ($where ne "FTP" && $where ne "CDROM")) {
+                                       $line->log_error("Misspelled variable: Valid names are USE_{BIN,SRC}_ON_{FTP,CDROM}.");
+                               }
+                       }
                }
        }
 
@@ -1616,7 +1637,7 @@
 
 sub checkfile_package_Makefile($$$$$) {
        my ($dir, $fname, $rawwhole, $lines, $loglines) = @_;
-       my ($distname, $svr4_pkgname, $category, $distfiles,
+       my ($distname, $category, $distfiles,
            $extract_sufx, $wrksrc);
        my ($abspkgdir, $whole, $tmp, $idx, @sections, @varnames);
        
@@ -1754,7 +1775,7 @@
        # check the items that have to be there.
        $tmp = "\n" . $tmp;
        foreach my $i ('DISTNAME', 'CATEGORIES') {
-               if ($tmp !~ /\n$i=/) {
+               if (!$seen_Makefile_common && $tmp !~ /\n$i=/) {
                        $opt_warn_vague && log_error(NO_FILE, NO_LINE_NUMBER, "$i has to be there.");
                }
                if ($tmp =~ /\n$i(\?=)/) {
@@ -1801,7 +1822,6 @@
        # check DISTFILES and related items.
        $distname     = expand_variable($tmp, "DISTNAME");
        $pkgname      = expand_variable($tmp, "PKGNAME");
-       $svr4_pkgname = expand_variable($tmp, "SVR4_PKGNAME");
        $extract_sufx = expand_variable($tmp, "EXTRACT_SUFX");
        $distfiles    = expand_variable($tmp, "DISTFILES");
 
@@ -1823,14 +1843,6 @@
        if ($opt_warn_vague && defined($pkgname) && defined($distname) && ($pkgname eq $distname || $pkgname eq "\${DISTNAME}")) {
                log_warning(NO_FILE, NO_LINE_NUMBER, "PKGNAME is \${DISTNAME} by default. You don't need to define PKGNAME.");
        }
-       if ($opt_warn_vague && defined($svr4_pkgname)) {
-               if ($svr4_pkgname =~ $regex_unresolved) {
-                       log_warning(NO_FILE, NO_LINE_NUMBER, "SVR4_PKGNAME must not contain references to other variables.");
-               } elsif (length($svr4_pkgname) > 5) {
-                       log_error(NO_FILE, NO_LINE_NUMBER, "SVR4_PKGNAME must not be longer than 5 characters.");
-               }
-       }
-
        if ($opt_warn_vague && defined($pkgname) && $pkgname !~ $regex_unresolved && $pkgname !~ $regex_pkgname) {
                log_warning(NO_FILE, NO_LINE_NUMBER, "PKGNAME should have the form packagename-version, where version consists only of digits, letters and dots.");
        }



Home | Main Index | Thread Index | Old Index