pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files Added support for LICENSE_FILE,...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d26e4612d915
branches:  trunk
changeset: 396524:d26e4612d915
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun Jul 26 19:30:33 2009 +0000

description:
Added support for LICENSE_FILE, OPSYSVARS and @pkgdir.

diffstat:

 pkgtools/pkglint/files/pkglint.pl |  27 ++++++++++++++++++++++++++-
 1 files changed, 26 insertions(+), 1 deletions(-)

diffs (63 lines):

diff -r f55799be79df -r d26e4612d915 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Sun Jul 26 19:09:25 2009 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Sun Jul 26 19:30:33 2009 +0000
@@ -1,5 +1,5 @@
 #! @PERL@
-# $NetBSD: pkglint.pl,v 1.817 2009/07/22 22:11:54 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.818 2009/07/26 19:30:33 rillig Exp $
 #
 
 # pkglint - static analyzer and checker for pkgsrc packages
@@ -2716,6 +2716,21 @@
        return false;
 }
 
+sub def_var($$) {
+       my ($line, $varname) = @_;
+       my $varcanon = varname_canon($varname);
+
+       if (defined($mkctx_vardef)) {
+               $mkctx_vardef->{$varname} = $line;
+               $mkctx_vardef->{$varcanon} = $line;
+       }
+
+       if (defined($pkgctx_vardef)) {
+               $pkgctx_vardef->{$varname} = $line;
+               $pkgctx_vardef->{$varcanon} = $line;
+       }
+}
+
 sub var_is_defined($) {
        my ($varname) = @_;
        my $varcanon = varname_canon($varname);
@@ -5874,6 +5889,7 @@
                [ "Legal issues", optional,
                        [
                                [ "LICENSE", once ],
+                               [ "LICENSE_FILE", optional ],
                                [ "RESTRICTED", optional ],
                                [ "NO_BIN_ON_CDROM", optional ],
                                [ "NO_BIN_ON_FTP", optional ],
@@ -6049,6 +6065,12 @@
                                use_var($svar, varname_canon($svar));
                                $opt_debug_misc and $line->log_debug("varuse $svar");
                        }
+
+               } elsif ($varcanon eq "OPSYSVARS") {
+                       foreach my $osvar (split(/\s+/, $line->get("value"))) {
+                               use_var($line, "$osvar.*");
+                               def_var($line, $osvar);
+                       }
                }
        }
 
@@ -7687,6 +7709,9 @@
                                        }
                                }
 
+                       } elsif ($cmd eq "pkgdir") {
+                               # TODO: What can we check here?
+
                        } else {
                                $line->log_warning("Unknown PLIST directive \"\@$cmd\".");
                        }



Home | Main Index | Thread Index | Old Index