pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc Updated pkglint to 4.22.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b10722e39be9
branches:  trunk
changeset: 499837:b10722e39be9
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Tue Sep 27 21:13:20 2005 +0000

description:
Updated pkglint to 4.22.

A distfile that only has an SHA1 checksum, but not an RMD160 one, is
considered an error. While at it, made the distinfo file check a little
stricter.

diffstat:

 doc/CHANGES                       |   3 +-
 pkgtools/pkglint/Makefile         |   4 +-
 pkgtools/pkglint/TODO             |   1 -
 pkgtools/pkglint/files/pkglint.pl |  50 +++++++++++++++++++++++++-------------
 4 files changed, 37 insertions(+), 21 deletions(-)

diffs (121 lines):

diff -r 77dbffdd4c2d -r b10722e39be9 doc/CHANGES
--- a/doc/CHANGES       Tue Sep 27 20:22:11 2005 +0000
+++ b/doc/CHANGES       Tue Sep 27 21:13:20 2005 +0000
@@ -1,4 +1,4 @@
-$NetBSD: CHANGES,v 1.11235 2005/09/27 20:22:11 wiz Exp $
+$NetBSD: CHANGES,v 1.11236 2005/09/27 21:14:08 rillig Exp $
 
 Changes to the packages collection and infrastructure in 2005:
 
@@ -4158,3 +4158,4 @@
        Updated emulators/DatUtil to 2.19 [wiz 2005-09-27]
        Updated emulators/MAMEDiff to 2.18 [wiz 2005-09-27]
        Updated devel/pcre to 6.4 [wiz 2005-09-27]
+       Updated pkgtools/pkglint to 4.22 [rillig 2005-09-27]
diff -r 77dbffdd4c2d -r b10722e39be9 pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Tue Sep 27 20:22:11 2005 +0000
+++ b/pkgtools/pkglint/Makefile Tue Sep 27 21:13:20 2005 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.254 2005/09/27 18:58:56 rillig Exp $
+# $NetBSD: Makefile,v 1.255 2005/09/27 21:13:20 rillig Exp $
 #
 
-DISTNAME=      pkglint-4.21.5
+DISTNAME=      pkglint-4.22
 CATEGORIES=    pkgtools devel
 MASTER_SITES=  # empty
 DISTFILES=     # empty
diff -r 77dbffdd4c2d -r b10722e39be9 pkgtools/pkglint/TODO
--- a/pkgtools/pkglint/TODO     Tue Sep 27 20:22:11 2005 +0000
+++ b/pkgtools/pkglint/TODO     Tue Sep 27 21:13:20 2005 +0000
@@ -1,4 +1,3 @@
-* fatal error if RMD160 missing
 * --autofix
 * pkglint <package>...
 * fix false positive warnings
diff -r 77dbffdd4c2d -r b10722e39be9 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Tue Sep 27 20:22:11 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Tue Sep 27 21:13:20 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.288 2005/09/27 18:58:56 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.289 2005/09/27 21:13:20 rillig Exp $
 #
 # This version contains lots of changes necessary for NetBSD packages
 # done by:
@@ -811,41 +811,57 @@
 
 sub checkfile_distinfo($$) {
        my ($dir, $fname) = @_;
-       my ($distinfo, %in_distinfo);
+       my ($lines, %in_distinfo, %sums);
 
        log_subinfo("checkfile_distinfo", $fname, NO_LINE_NUMBER, undef);
 
        checkperms($fname);
-       if (!($distinfo = load_file($fname))) {
+       if (!($lines = load_file($fname))) {
                log_error($fname, NO_LINE_NUMBER, "Cannot be read.");
                return;
        }
 
-       if (@{$distinfo} == 0) {
+       if (@{$lines} == 0) {
                log_error($fname, NO_LINE_NUMBER, "Must not be empty.");
                return;
        }
 
-       checkline_rcsid($distinfo->[0], "");
-
-       foreach my $line (@{$distinfo}) {
-               next unless $line->text =~ /^(MD5|SHA1|RMD160) \(([^)]+)\) = (.*)$/;
-               my ($alg, $patch, $sum) = ($1, $2, $3);
-
-               if ($patch =~ /^patch-[A-Za-z0-9]+$/) {
-                       if (-f "${dir}/$patchdir/$patch") {
-                               my $chksum = `sed -e '/\$NetBSD.*/d' $dir/$patchdir/$patch | digest $alg`;
+       checkline_rcsid($lines->[0], "");
+       if (1 <= $#{$lines} && $lines->[1]->text ne "") {
+               $lines->[1]->log_warning("Empty line expected.");
+       }
+
+       foreach my $line (@{$lines}[2..$#{$lines}]) {
+               if ($line->text !~ /^(MD5|SHA1|RMD160|Size) \(([^)]+)\) = (.*)(?: bytes)?$/) {
+                       $line->log_error("Unknown line type.");
+                       next;
+               }
+
+               my ($alg, $file, $sum) = ($1, $2, $3);
+
+               if ($file =~ /^patch-[A-Za-z0-9]+$/) {
+                       if (-f "${dir}/${patchdir}/${file}") {
+                               my $chksum = `sed -e '/\$NetBSD.*/d' $dir/$patchdir/$file | digest $alg`;
                                $chksum =~ s/\r*\n*\z//;
                                if ($sum ne $chksum) {
-                                       $line->log_error("Checksum of $patch differs. Rerun '$conf_make makepatchsum'.");
+                                       $line->log_error("Checksum of $file differs. Rerun '$conf_make makepatchsum'.");
                                }
                        } else {
-                               $line->log_warning("$patch does not exist.");
+                               $line->log_warning("$file does not exist.");
                        }
+               } else {
+                       $sums{$alg}->{$file} = $line;
                }
-               $in_distinfo{$patch} = true;
+               $in_distinfo{$file} = true;
        }
-       checklines_trailing_empty_lines($distinfo);
+       checklines_trailing_empty_lines($lines);
+
+       # Check for distfiles that have SHA1, but not RMD160 checksums
+       foreach my $sha1_file (sort(keys(%{$sums{"SHA1"}}))) {
+               if (!exists($sums{"RMD160"}->{$sha1_file})) {
+                       $sums{"SHA1"}->{$sha1_file}->log_error("RMD160 checksum missing for \"${sha1_file}\".");
+               }
+       }
 
        foreach my $patch (<${dir}/$patchdir/patch-*>) {
                $patch = basename($patch);



Home | Main Index | Thread Index | Old Index