pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc Update pkglint to 3.80. Changes to lintpkgsrc.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/636378a71a8f
branches:  trunk
changeset: 477200:636378a71a8f
user:      abs <abs%pkgsrc.org@localhost>
date:      Sun Jun 27 22:47:38 2004 +0000

description:
Update pkglint to 3.80. Changes to lintpkgsrc.
 - Append appropriate dirs to path - should fix pkg/23534
 - Undefined variables evaluate to blank not UNDEFINED - should fix pkg/24475
 - Handle ${C and ${S constructs that use separators other than /
 - Slightly more debugging
 - die if uname fails

diffstat:

 doc/CHANGES                          |   3 ++-
 pkgtools/pkglint/Makefile            |   4 ++--
 pkgtools/pkglint/files/lintpkgsrc.pl |  26 ++++++++++++++++----------
 3 files changed, 20 insertions(+), 13 deletions(-)

diffs (133 lines):

diff -r 3d0c4719b03d -r 636378a71a8f doc/CHANGES
--- a/doc/CHANGES       Sun Jun 27 22:09:27 2004 +0000
+++ b/doc/CHANGES       Sun Jun 27 22:47:38 2004 +0000
@@ -1,4 +1,4 @@
-$NetBSD: CHANGES,v 1.6355 2004/06/27 21:41:39 abs Exp $
+$NetBSD: CHANGES,v 1.6356 2004/06/27 22:48:11 abs Exp $
 
 Changes to the packages collection and infrastructure in 2004:
 
@@ -3115,4 +3115,5 @@
        Removed xml-i18n-tools [jmmv 2004-06-27]
        Updated uptimec to 0.2p3 [xtraeme 2004-06-27]
        Added cambevao 2.0 [abs 2004-06-27]
+       Updated pkglint to 3.80 [abs 2004-06-27]
 
diff -r 3d0c4719b03d -r 636378a71a8f pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Sun Jun 27 22:09:27 2004 +0000
+++ b/pkgtools/pkglint/Makefile Sun Jun 27 22:47:38 2004 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.192 2004/06/26 18:53:17 hubertf Exp $
+# $NetBSD: Makefile,v 1.193 2004/06/27 22:47:38 abs Exp $
 #
 
-DISTNAME=      pkglint-3.79
+DISTNAME=      pkglint-3.80
 CATEGORIES=    pkgtools devel
 MASTER_SITES=  # empty
 DISTFILES=     # empty
diff -r 3d0c4719b03d -r 636378a71a8f pkgtools/pkglint/files/lintpkgsrc.pl
--- a/pkgtools/pkglint/files/lintpkgsrc.pl      Sun Jun 27 22:09:27 2004 +0000
+++ b/pkgtools/pkglint/files/lintpkgsrc.pl      Sun Jun 27 22:47:38 2004 +0000
@@ -1,6 +1,6 @@
 #!@PERL@
 
-# $NetBSD: lintpkgsrc.pl,v 1.89 2004/05/10 00:19:43 atatat Exp $
+# $NetBSD: lintpkgsrc.pl,v 1.90 2004/06/27 22:47:38 abs Exp $
 
 # Written by David Brownlee <abs%netbsd.org@localhost>.
 #
@@ -29,7 +29,7 @@
        %prebuilt_pkgdir_cache, # To avoid symlink loops in prebuilt_pkgdirs
        );
 
-$ENV{PATH} .= ':/usr/sbin';
+$ENV{PATH} .= ':/bin:/usr/bin:/sbin:/usr/sbin:@PREFIX@/sbin:@PREFIX@/bin';
 
 if (! getopts('BDE:I:K:LM:OP:RSVdg:hilmopru', \%opt) || $opt{h} ||
        ! ( defined($opt{d}) || defined($opt{g}) || defined($opt{i}) ||
@@ -408,6 +408,8 @@
     ( $default_vars->{OPSYS},
        $default_vars->{OS_VERSION},
        $default_vars->{MACHINE} ) = (split);
+    if (!$default_vars->{MACHINE})
+       { die('Unable to extract machine from uname'); }
 
     # Handle systems without uname -p  (NetBSD pre 1.4)
     chomp($default_vars->{MACHINE_ARCH} = `uname -p 2>/dev/null`);
@@ -724,6 +726,11 @@
        { $pkgname = $vars->{PKGNAME}; }
     elsif (defined $vars->{DISTNAME})
        { $pkgname = $vars->{DISTNAME}; }
+    if (defined $vars->{PKGNAME})
+       { debug("$file: PKGNAME=$vars->{PKGNAME}\n"); }
+    if (defined $vars->{DISTNAME})
+       { debug("$file: DISTNAME=$vars->{DISTNAME}\n"); }
+
     if ($pkgname !~ /(.*)-(\d.*)/)
        {
        # invoke make here as a last resort
@@ -783,7 +790,6 @@
        %incfiles,
        @if_false); # 0:true 1:false 2:nested-false&nomore-elsif
 
-
     if (! open(FILE, $file))
        { return(undef); }
     @data = map {chomp; $_} <FILE>;
@@ -974,16 +980,16 @@
                # If $vars{$subvar} contains a $ skip it on this pass.
                # Hopefully it will get substituted and we can catch it
                # next time around.
-               if (index($result, '${') != -1)
+               if (index($result, '${') != -1)  #} to help bracket match
                    { next; }
 
                debug("$file: substitutelist $key ($result) $subvar (@patterns)\n");
                foreach (@patterns)
                    {
-                   if (! m#([CS])/([^/]+)/([^/]*)/([1g]*)#)
+                   if (! m#([CS])(.)([^/]+)\2([^/]*)\2([1g]*)#)
                        { next; }
 
-                   my($how, $from, $to, $global) = ($1, $2, $3, $4);
+                   my($how, $from, $to, $global) = ($1, $3, $4, $5);
 
                    debug("$file: substituteglob $subvar, $how, $from, $to, $global\n");
                    if ($how eq 'S') # Limited substitution - keep ^ and $
@@ -1017,7 +1023,7 @@
        if (defined(${$vars}{$1}))
            { $line = $`.${$vars}{$1}.$'; }
        else
-           { $line = $`.'UNDEFINED'.$'; }
+           { $line = $`.$'; }
        }
     $line;
     }
@@ -1031,7 +1037,7 @@
        if (defined(${$vars}{$1}))
            { $line = $`.${$vars}{$1}.$'; }
        else
-           { $line = $`.'UNDEFINED'.$'; }
+           { $line = $`.$'; }
        }
     $line;
     }
@@ -1141,7 +1147,7 @@
        }
     $pkglist = new PkgList;
     @categories = list_pkgsrc_categories($pkgsrcdir);
-    verbose("Scanning pkgsrc Makefiles: ");
+    verbose("Scanning Makefiles: ");
     if (!$opt{L})
        { verbose('_'x@categories."\b"x@categories); }
     else
@@ -1201,7 +1207,7 @@
 
     @categories = list_pkgsrc_categories($pkgsrcdir);
 
-    verbose("Scanning pkgsrc distinfo: ".'_'x@categories."\b"x@categories);
+    verbose("Scanning distinfo: ".'_'x@categories."\b"x@categories);
     $numpkg = 0;
     foreach my $cat (sort @categories)
        {



Home | Main Index | Thread Index | Old Index