summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig>2005-09-27 21:13:20 +0000
committerrillig <rillig>2005-09-27 21:13:20 +0000
commit6ead3a62aff183edf7522bba9c4a409d3736973d (patch)
tree165c003b2d26a8e8b7ad3e4650a8d908ad2e8257 /pkgtools
parentf26cf304103e61d6dc3542a4e4a01a91eaad4ad1 (diff)
downloadpkgsrc-6ead3a62aff183edf7522bba9c4a409d3736973d.tar.gz
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 (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/Makefile4
-rw-r--r--pkgtools/pkglint/TODO1
-rw-r--r--pkgtools/pkglint/files/pkglint.pl46
3 files changed, 33 insertions, 18 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile
index a6f51a4af2b..d3ec8872191 100644
--- a/pkgtools/pkglint/Makefile
+++ b/pkgtools/pkglint/Makefile
@@ -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 --git a/pkgtools/pkglint/TODO b/pkgtools/pkglint/TODO
index 7f6e3f32f30..5516cdb6993 100644
--- a/pkgtools/pkglint/TODO
+++ b/pkgtools/pkglint/TODO
@@ -1,4 +1,3 @@
-* fatal error if RMD160 missing
* --autofix
* pkglint <package>...
* fix false positive warnings
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index ff4bf0ab9d8..4a783e472f4 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -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_DESCR($$) {
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], "");
+ checkline_rcsid($lines->[0], "");
+ if (1 <= $#{$lines} && $lines->[1]->text ne "") {
+ $lines->[1]->log_warning("Empty line expected.");
+ }
- foreach my $line (@{$distinfo}) {
- next unless $line->text =~ /^(MD5|SHA1|RMD160) \(([^)]+)\) = (.*)$/;
- my ($alg, $patch, $sum) = ($1, $2, $3);
+ foreach my $line (@{$lines}[2..$#{$lines}]) {
+ if ($line->text !~ /^(MD5|SHA1|RMD160|Size) \(([^)]+)\) = (.*)(?: bytes)?$/) {
+ $line->log_error("Unknown line type.");
+ next;
+ }
- if ($patch =~ /^patch-[A-Za-z0-9]+$/) {
- if (-f "${dir}/$patchdir/$patch") {
- my $chksum = `sed -e '/\$NetBSD.*/d' $dir/$patchdir/$patch | digest $alg`;
+ 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{$file} = true;
+ }
+ 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}\".");
}
- $in_distinfo{$patch} = true;
}
- checklines_trailing_empty_lines($distinfo);
foreach my $patch (<${dir}/$patchdir/patch-*>) {
$patch = basename($patch);