pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files The list of files that define t...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5c3bd95836a4
branches:  trunk
changeset: 511795:5c3bd95836a4
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Apr 22 11:22:40 2006 +0000

description:
The list of files that define the TOOLS is extracted from bsd.tools.mk
instead of specifying it explicitly.

diffstat:

 pkgtools/pkglint/files/pkglint.pl |  35 ++++++++++++++++++++++++++++++-----
 1 files changed, 30 insertions(+), 5 deletions(-)

diffs (55 lines):

diff -r e1f591456551 -r 5c3bd95836a4 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Sat Apr 22 10:54:53 2006 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Sat Apr 22 11:22:40 2006 +0000
@@ -1,5 +1,5 @@
 #! @PERL@
-# $NetBSD: pkglint.pl,v 1.561 2006/04/21 09:42:01 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.562 2006/04/22 11:22:40 rillig Exp $
 #
 
 # pkglint - static analyzer and checker for pkgsrc packages
@@ -1694,15 +1694,40 @@
 my $load_tool_names_varname_to_toolname = undef;
 my $load_tool_names_predefined_vartools = undef;
 sub load_tool_names() {
-       my ($tools, $vartools, $predefined_vartools, $varname_to_toolname);
+       my ($tools, $vartools, $predefined_vartools, $varname_to_toolname, @tool_files);
+
+       #
+       # Get the list of files that define the tools from bsd.tools.mk.
+       #
+
+       @tool_files = ();
+       {
+               my $fname = "${current_dir}/${pkgsrcdir}/mk/tools/bsd.tools.mk";
+               my $lines = load_lines($fname, true);
+               if (!$lines) {
+                       log_fatal($fname, NO_LINE_NUMBER, "Cannot be read.");
+               }
+
+               foreach my $line (@{$lines}) {
+                       if ($line->text =~ regex_mk_include) {
+                               my ($includefile) = ($1);
+                               if ($includefile =~ qr"^\.\./\.\./mk/tools/(.*)$") {
+                                       push(@tool_files, $1);
+                               }
+                       }
+               }
+       }
+
+       #
+       # Scan the tool files for the actual definitions of the tools.
+       #
 
        $tools = {};
        $vartools = {};
        $predefined_vartools = {};
        $varname_to_toolname = {};
-       # TODO: get the list of additional tool files from bsd.tools.mk
-       foreach my $basename (qw(autoconf automake defaults gettext ldconfig make replace rpcgen texinfo)) {
-               my $fname = "${current_dir}/${pkgsrcdir}/mk/tools/${basename}.mk";
+       foreach my $basename (@tool_files) {
+               my $fname = "${current_dir}/${pkgsrcdir}/mk/tools/${basename}";
                my $lines = load_lines($fname, true);
 
                if (!$lines) {



Home | Main Index | Thread Index | Old Index