From 69d0d7df9eb812d8ae5f531bb0dba9c2df725753 Mon Sep 17 00:00:00 2001 From: schmonz Date: Tue, 26 Mar 2013 15:11:20 +0000 Subject: Excessive self-grepping causes bugginess. Don't! This regex almost certainly didn't intend to match an occurrence of "ARRAY" in PkgLint::Line, but it did match. --- pkgtools/pkglint/files/pkglint.pl | 7 ++----- pkgtools/pkglint/files/pkglint.t | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'pkgtools/pkglint') diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index d65e79a75f3..ccc6653a49e 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.pl,v 1.853 2013/03/26 15:10:57 schmonz Exp $ +# $NetBSD: pkglint.pl,v 1.854 2013/03/26 15:11:20 schmonz Exp $ # # pkglint - static analyzer and checker for pkgsrc packages @@ -649,10 +649,7 @@ sub get_vartypes_basictypes() { my $types = {}; assert($lines, "Couldn't load pkglint.pl from $program"); foreach my $line (@$lines) { - if ($line->text =~ m"^\s+\} elsif \(\$type eq \"(\w+)\"\) \{$") { - # still finds "ARRAY" -- probably unintentional! - $types->{$1} = 1; - } elsif ($line->text =~ m"^\s+(\w+) => sub \{$") { + if ($line->text =~ m"^\s+(\w+) => sub \{$") { # XXX lookup in %type_dispatch instead $types->{$1} = 1; } diff --git a/pkgtools/pkglint/files/pkglint.t b/pkgtools/pkglint/files/pkglint.t index a32c98af84f..fdeb03a64b4 100644 --- a/pkgtools/pkglint/files/pkglint.t +++ b/pkgtools/pkglint/files/pkglint.t @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.t,v 1.7 2013/03/26 15:10:32 schmonz Exp $ +# $NetBSD: pkglint.t,v 1.8 2013/03/26 15:11:20 schmonz Exp $ # require 'pkglint.pl'; # so we can test its internals @@ -71,7 +71,7 @@ sub test_get_vartypes_basictypes { my %types = %{$results[0]}; my @all_vartypes_basictypes = qw( - ARRAY AwkCommand BrokenIn + AwkCommand BrokenIn BuildlinkDepmethod BuildlinkDepth BuildlinkPackages CFlag Category Comment Dependency DependencyWithPath -- cgit v1.2.3