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 OVERRIDE_DIRDEPTH to th...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/aaff52d50cd3
branches:  trunk
changeset: 515691:aaff52d50cd3
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Thu Jul 06 17:40:17 2006 +0000

description:
- Added OVERRIDE_DIRDEPTH to the list of known variables.
- Added the -Cglobal option for inter-package checks (disabled by
  default) that may consume a lot of memory.
- Adjusted pkglint to another change in the TOOLS framework which had
  not been detected automatically.
- MD5 checksums are no longer deprecated, they are now obsolete.

diffstat:

 pkgtools/pkglint/files/makevars.map |   3 ++-
 pkgtools/pkglint/files/pkglint.pl   |  36 +++++++++++++++++++++++++++++++-----
 2 files changed, 33 insertions(+), 6 deletions(-)

diffs (104 lines):

diff -r bc0948245fe3 -r aaff52d50cd3 pkgtools/pkglint/files/makevars.map
--- a/pkgtools/pkglint/files/makevars.map       Thu Jul 06 17:39:36 2006 +0000
+++ b/pkgtools/pkglint/files/makevars.map       Thu Jul 06 17:40:17 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: makevars.map,v 1.124 2006/07/04 10:01:03 rillig Exp $
+# $NetBSD: makevars.map,v 1.125 2006/07/06 17:40:17 rillig Exp $
 #
 
 # This file contains the guessed type of some variables, according to
@@ -447,6 +447,7 @@
 OPSYSVARS              List of Varname [m:a,c:a]
 OSVERSION_SPECIFIC     Yes [m:s,c:s]
 OS_VERSION             Version [$system]
+OVERRIDE_DIRDEPTH      Integer [$package]
 OVERRIDE_GNU_CONFIG_SCRIPTS    Yes [$package]
 OWN_DIRS               List of Pathname [$package_list]
 OWN_DIRS_PERMS         List of ShellWord [$package_list]
diff -r bc0948245fe3 -r aaff52d50cd3 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Thu Jul 06 17:39:36 2006 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Thu Jul 06 17:40:17 2006 +0000
@@ -1,5 +1,5 @@
 #! @PERL@
-# $NetBSD: pkglint.pl,v 1.636 2006/07/04 09:29:54 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.637 2006/07/06 17:40:17 rillig Exp $
 #
 
 # pkglint - static analyzer and checker for pkgsrc packages
@@ -1588,6 +1588,7 @@
 my $opt_check_DESCR    = true;
 my $opt_check_distinfo = true;
 my $opt_check_extra    = false;
+my $opt_check_global   = false;
 my $opt_check_INSTALL  = true;
 my $opt_check_Makefile = true;
 my $opt_check_MESSAGE  = true;
@@ -1600,6 +1601,7 @@
        "DESCR"         => [\$opt_check_DESCR, "check DESCR file"],
        "distinfo"      => [\$opt_check_distinfo, "check distinfo file"],
        "extra"         => [\$opt_check_extra, "check various additional files"],
+       "global"        => [\$opt_check_global, "inter-package checks"],
        "INSTALL"       => [\$opt_check_INSTALL, "check INSTALL and DEINSTALL scripts"],
        "Makefile"      => [\$opt_check_Makefile, "check Makefiles"],
        "MESSAGE"       => [\$opt_check_MESSAGE, "check MESSAGE files"],
@@ -1799,6 +1801,12 @@
 my $is_wip;                    # Is the current directory from pkgsrc-wip?
 my $is_internal;               # Is the current item from the infrastructure?
 
+#
+# Variables for inter-package checks.
+#
+
+my $ipc_distinfo;              # Maps "$alg:$fname" => "checksum".
+
 # Context of the package that is currently checked.
 my $pkgdir;                    # PKGDIR from the package Makefile
 my $filesdir;                  # FILESDIR from the package Makefile
@@ -2324,7 +2332,8 @@
                                } elsif ($varname =~ qr"^(?:TOOLS_PATH|_TOOLS_DEPMETHOD)\.([-\w.]+|\[)$") {
                                        $tools->{$1} = true;
 
-                               } elsif ($varname =~ qr"^_TOOLS\.") {
+                               } elsif ($varname =~ qr"^_TOOLS\.(.*)") {
+                                       $tools->{$1} = true;
                                        foreach my $tool (split(qr"\s+", $value)) {
                                                $tools->{$tool} = true;
                                        }
@@ -4625,7 +4634,7 @@
                                }
 
                                if ($p !~ qr"^[\$/]") {
-                                       $line->log_warning("All components of ${varname} (in this case \"${p}\")should be an absolute path.");
+                                       $line->log_warning("All components of ${varname} (in this case \"${p}\") should be an absolute path.");
                                }
                        }
                }
@@ -5813,9 +5822,26 @@
                my ($alg, $chksum_fname, $sum) = ($1, $2, $3);
                my $is_patch = (($chksum_fname =~ qr"^patch-[A-Za-z0-9]+$") ? true : false);
 
+               # Inter-package check for differing distfile checksums.
+               if ($opt_check_global && !$is_patch) {
+                       # Note: Perl-specific auto-population.
+                       if (exists($ipc_distinfo->{$alg}->{$chksum_fname})) {
+                               my $other = $ipc_distinfo->{$alg}->{$chksum_fname};
+
+                               if ($other->[1] eq $sum) {
+                                       # Fine.
+                               } else {
+                                       $line->log_error("The ${alg} checksum for ${chksum_fname} differs ...");
+                                       $other->[0]->log_error("... from this one.");
+                               }
+                       } else {
+                               $ipc_distinfo->{$alg}->{$chksum_fname} = [$line, $sum];
+                       }
+               }
+
                if ($alg eq "MD5") {
-                       $line->log_warning("MD5 checksums are deprecated.");
-                       $line->explain_warning(
+                       $line->log_error("MD5 checksums are obsolete.");
+                       $line->explain_error(
                                "Run \"".conf_make." makedistinfo\" to regenerate the distinfo file.");
                        next;
                }



Home | Main Index | Thread Index | Old Index