diff options
-rw-r--r-- | pkgtools/pkglint/Makefile | 4 | ||||
-rwxr-xr-x | pkgtools/pkglint/files/lintpkgsrc.pl | 22 |
2 files changed, 15 insertions, 11 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile index ee3f1485edd..59a5851bbe2 100644 --- a/pkgtools/pkglint/Makefile +++ b/pkgtools/pkglint/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.9 1999/04/19 07:32:09 abs Exp $ +# $NetBSD: Makefile,v 1.10 1999/06/05 00:32:39 abs Exp $ # -DISTNAME= pkglint-1.70 +DISTNAME= pkglint-1.71 CATEGORIES= pkgtools devel MASTER_SITES= # empty DISTFILES= # empty diff --git a/pkgtools/pkglint/files/lintpkgsrc.pl b/pkgtools/pkglint/files/lintpkgsrc.pl index 8b19ec41794..1ee450d73cd 100755 --- a/pkgtools/pkglint/files/lintpkgsrc.pl +++ b/pkgtools/pkglint/files/lintpkgsrc.pl @@ -1,6 +1,6 @@ #!/usr/bin/env perl -# $NetBSD: lintpkgsrc.pl,v 1.2 1999/04/19 07:36:43 abs Exp $ +# $NetBSD: lintpkgsrc.pl,v 1.3 1999/06/05 00:32:40 abs Exp $ # (Somewhat quickly) Written by David Brownlee <abs@anim.dreamworks.com>. # Caveats: @@ -70,27 +70,27 @@ sub list_possible_versions my($pkg,%pkg2dir)=@_; my($pkgname,@maybe,$fail); - if( !defined($pkg2dir{$pkg}) ) + if (!defined($pkg2dir{$pkg})) { $pkgname=$pkg; - $pkgname =~ s/-[^-]+$//; + $pkgname =~ s/-[^-]+$/-/; foreach ( sort keys %pkg2dir ) { - if( substr($_,0,length($pkgname)) eq $pkgname ) + if (/^$pkgname[0-9]/) { push(@maybe,$_); } } $_="Unknown package: '$pkg'"; if( @maybe ) { $_.=" (Maybe @maybe)"; } else - { $_.=" (DBG $pkgname)"; } + { $_.=" ($pkgname)"; } print "$_\n"; $fail=1; } $fail; } -# List (recursive) non diretory contents of specified directory +# List (recursive) non directory contents of specified directory # sub listdir { @@ -178,9 +178,13 @@ sub parse_makefile if ($vars{$key} =~ m#\${(\w+):S/(\w+)/(\w+)/}#) { my($var,$from,$to)=($1,$2,$3); - $_=$vars{$var}; - s/$from/$to/; - $vars{$key} =~ s#\${$var:S/$from/$to/}#$_#; + + if (defined($vars{$var})) + { + $_=$vars{$var}; + s/$from/$to/; + $vars{$key} =~ s#\${$var:S/$from/$to/}#$_#; + } } $vars{$key} =~ s/\$\{$value\}/$vars{$value}/g; } |