diff options
author | abs <abs> | 2004-06-27 22:47:38 +0000 |
---|---|---|
committer | abs <abs> | 2004-06-27 22:47:38 +0000 |
commit | c93c54f0bdab92001955ef62dcb050abae8b6505 (patch) | |
tree | 9fe1117b13fe13cd271d35ce2aabc210efcde3bc /pkgtools | |
parent | 8a8239cadde6f0c765bbf562a0118a438ee2c57f (diff) | |
download | pkgsrc-c93c54f0bdab92001955ef62dcb050abae8b6505.tar.gz |
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 (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/Makefile | 4 | ||||
-rwxr-xr-x | pkgtools/pkglint/files/lintpkgsrc.pl | 26 |
2 files changed, 18 insertions, 12 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile index 1a90842fe61..acc4b45ea23 100644 --- a/pkgtools/pkglint/Makefile +++ b/pkgtools/pkglint/Makefile @@ -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 --git a/pkgtools/pkglint/files/lintpkgsrc.pl b/pkgtools/pkglint/files/lintpkgsrc.pl index f5bac20295b..cf67e9ed631 100755 --- a/pkgtools/pkglint/files/lintpkgsrc.pl +++ b/pkgtools/pkglint/files/lintpkgsrc.pl @@ -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>. # @@ -29,7 +29,7 @@ my( $pkglist, # list of Pkg packages %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 @@ sub get_default_makefile_vars ( $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 @@ sub parse_makefile_pkgsrc { $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 @@ sub parse_makefile_vars %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 @@ sub parse_makefile_vars # 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 @@ sub parse_expand_vars if (defined(${$vars}{$1})) { $line = $`.${$vars}{$1}.$'; } else - { $line = $`.'UNDEFINED'.$'; } + { $line = $`.$'; } } $line; } @@ -1031,7 +1037,7 @@ sub parse_expand_vars_dumb if (defined(${$vars}{$1})) { $line = $`.${$vars}{$1}.$'; } else - { $line = $`.'UNDEFINED'.$'; } + { $line = $`.$'; } } $line; } @@ -1141,7 +1147,7 @@ sub scan_pkgsrc_makefiles } $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 @@ sub scan_pkgsrc_distfiles_vs_distinfo @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) { |