diff options
author | rillig <rillig@pkgsrc.org> | 2005-11-21 22:06:30 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2005-11-21 22:06:30 +0000 |
commit | 3ffb27719a75d2887040417fa8c7ae1e2bba10c7 (patch) | |
tree | 09fb678c82ddb93755e3f004de8dd41cda24d49c /pkgtools | |
parent | 43b91a245c93035fb34723b18e535b20163ae241 (diff) | |
download | pkgsrc-3ffb27719a75d2887040417fa8c7ae1e2bba10c7.tar.gz |
Updated pkglint to 4.45.
- Fixed perl -T warnings:
- Replaced $#{@{$lines}} with $#{$lines}.
- Avoided calls to external programs (sed and digest).
- Removed redundant warning if DISTNAME is set to an invalid package name
and PKGNAME is not defined.
- Changed dependency from pkgtools/digest to security/p5-Digest-SHA1.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/Makefile | 8 | ||||
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 20 |
2 files changed, 14 insertions, 14 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile index b3e3057f81e..08437606434 100644 --- a/pkgtools/pkglint/Makefile +++ b/pkgtools/pkglint/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.304 2005/11/20 20:09:35 rillig Exp $ +# $NetBSD: Makefile,v 1.305 2005/11/21 22:06:30 rillig Exp $ # -DISTNAME= pkglint-4.44 -CATEGORIES= pkgtools devel +DISTNAME= pkglint-4.45 +CATEGORIES= pkgtools MASTER_SITES= # empty DISTFILES= # empty @@ -10,7 +10,7 @@ MAINTAINER= rillig@NetBSD.org HOMEPAGE= http://www.netbsd.org/Documentation/pkgsrc/ COMMENT= Verifier for NetBSD packages and complete pkgsrc tree -DEPENDS+= digest>=20010101:../../pkgtools/digest +DEPENDS+= p5-Digest-SHA1-[0-9]*:../../security/p5-Digest-SHA1 PKG_INSTALLATION_TYPES= overwrite pkgviews diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 9358b8ee60e..9a48b26b086 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.375 2005/11/21 07:24:51 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.376 2005/11/21 22:06:30 rillig Exp $ # # This version contains lots of changes necessary for NetBSD packages # done by: @@ -435,7 +435,7 @@ sub get_logical_line($$$) { } } - if ($lineno > $#{@{$lines}}) { + if ($lineno > $#{$lines}) { # The last line in the file is a continuation line $lineno--; } @@ -561,6 +561,7 @@ package main; use strict; use warnings; +use Digest::SHA1; use Getopt::Long qw(:config no_ignore_case bundling require_order); use Fcntl qw(:mode); use File::Basename; @@ -1147,11 +1148,13 @@ sub checkfile_distinfo($) { my ($alg, $file, $sum) = ($1, $2, $3); if ($file =~ /^patch-[A-Za-z0-9]+$/) { - if (-f "${current_dir}/${patchdir}/${file}") { - open(DIG, "sed '/\\\$NetBSD.*/d' ${current_dir}/${patchdir}/${file} | digest ${alg} |") or die; - my $chksum = <DIG>; - close(DIG); - chomp($chksum); + if (open(PATCH, "< ${current_dir}/${patchdir}/${file}")) { + my $data = ""; + foreach my $patchline (<PATCH>) { + $data .= $patchline unless $patchline =~ qr"\$NetBSD.*\$"; + } + close(PATCH); + my $chksum = Digest::SHA1::sha1_hex($data); if ($sum ne $chksum) { $line->log_error("${alg} checksum of $file differs (expected ${sum}, got ${chksum}). Rerun '".conf_make." makepatchsum'."); } @@ -2588,9 +2591,6 @@ sub checkfile_package_Makefile($$$$) { if (defined($pkgname) && defined($distname) && ($pkgname eq $distname || $pkgname eq "\${DISTNAME}")) { log_warning($fname, NO_LINE_NUMBER, "PKGNAME is \${DISTNAME} by default. You don't need to define PKGNAME."); } - if (defined($pkgname) && $pkgname !~ regex_unresolved && $pkgname !~ regex_pkgname) { - log_warning($fname, NO_LINE_NUMBER, "PKGNAME should have the form packagename-version, where version consists only of digits, letters and dots."); - } if (!defined($pkgname) && defined($distname) && $distname !~ regex_unresolved && $distname !~ regex_pkgname) { log_warning($fname, NO_LINE_NUMBER, "As DISTNAME ist not a valid package name, please define the PKGNAME explicitly."); |