pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files Removed global variable %seen_M...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b8141d473581
branches:  trunk
changeset: 497110:b8141d473581
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Wed Jul 20 17:11:56 2005 +0000

description:
Removed global variable %seen_Makefile_include.

diffstat:

 pkgtools/pkglint/files/pkglint.pl |  18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diffs (84 lines):

diff -r ec290ea0a507 -r b8141d473581 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Wed Jul 20 17:08:59 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Wed Jul 20 17:11:56 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.207 2005/07/20 17:08:59 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.208 2005/07/20 17:11:56 rillig Exp $
 #
 # This version contains lots of changes necessary for NetBSD packages
 # done by:
@@ -350,7 +350,6 @@
 my $distinfo_file;
 my $scriptdir;
 my $seen_USE_PKGLOCALEDIR;
-my %seen_Makefile_include;
 my $seen_Makefile_common;
 my $pkgname;
 my %make_vars_typemap;
@@ -369,7 +368,7 @@
 sub check_package($);
 
 sub checkperms($);
-sub readmakefile($$$);
+sub readmakefile($$$$);
 sub checkextra($$);
 sub checkorder($$@);
 sub checkearlier($@);
@@ -382,7 +381,6 @@
        $distinfo_file          = "distinfo";
        $scriptdir              = "scripts";
        $seen_USE_PKGLOCALEDIR  = false;
-       %seen_Makefile_include  = ();
        $seen_Makefile_common   = false;
        $pkgname                = undef;
        %make_vars_typemap      = ();
@@ -1054,8 +1052,8 @@
        return true;
 }
 
-sub readmakefile($$$) {
-       my ($dir, $file, $all_lines) = @_;
+sub readmakefile($$$$) {
+       my ($dir, $file, $all_lines, $seen_Makefile_include) = @_;
        my $contents = "";
        my ($includefile, $dirname, $savedln, $level, $lines);
 
@@ -1076,7 +1074,7 @@
                # try to get any included file
                if ($line->text =~ qr"^\.\s*include\s+\"([-./\w]+)\"$") {
                        $includefile = $1;
-                       if (exists($seen_Makefile_include{$includefile})) {
+                       if (exists($seen_Makefile_include->{$includefile})) {
                                $contents .= "### pkglint ### skipped $includefile\n";
                                next;
                        }
@@ -1085,7 +1083,7 @@
                                next;
                        }
 
-                       $seen_Makefile_include{$includefile} = true;
+                       $seen_Makefile_include->{$includefile} = true;
                        if ($includefile =~ qr"Makefile\.common$") {
                                $seen_Makefile_common = true;
                        }
@@ -1107,7 +1105,7 @@
                                        $line->log_error("Cannot read $dirname/$includefile.");
                                } else {
                                        $line->log_info("Including $dirname/$includefile");
-                                       $contents .= readmakefile($dir, "$dirname/$includefile", $all_lines);
+                                       $contents .= readmakefile($dir, "$dirname/$includefile", $all_lines, $seen_Makefile_include);
                                }
                        }
                } elsif ($line->text =~ qr"^\.\s*include\s+(.*)") {
@@ -1308,7 +1306,7 @@
        checkperms($fname);
 
        $tmp = 0;
-       $rawwhole = readmakefile($dir, $fname, $lines = []);
+       $rawwhole = readmakefile($dir, $fname, $lines = [], {});
        if (!$rawwhole) {
                log_error($fname, NO_LINE_NUMBER, "Cannot be read.");
                return false;



Home | Main Index | Thread Index | Old Index