From 569ac5bf230d5e2980c242c7f0c8c460fac560a5 Mon Sep 17 00:00:00 2001 From: agc Date: Tue, 17 Nov 1998 17:19:23 +0000 Subject: Stop failing with a fatal error if ${FILESDIR}/md5 file does not exist - some perfectly sane packages do not have ${FILESDIR}/md5 files. Including pkgsrc/pkgtools/pkglint, funnily enough. In its place, introduce a checkmd5 subroutine, and call it if the file is present. This subroutine checks for the presence of the NetBSD RCS Id in the file. --- pkgtools/pkglint/files/pkglint.pl | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'pkgtools') diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 67e4751905f..02c3519354b 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.4 1998/11/11 12:07:44 agc Exp $ +# $NetBSD: pkglint.pl,v 1.5 1998/11/17 17:19:23 agc Exp $ # # This version contains some changes necessary for NetBSD packages # done by Hubert Feyrer and @@ -136,10 +136,10 @@ EOF # # check for files. # -@checker = ('pkg/COMMENT', 'pkg/DESCR', 'Makefile', 'files/md5'); +@checker = ('pkg/COMMENT', 'pkg/DESCR', 'Makefile'); %checker = ('pkg/COMMENT', 'checkdescr', - 'pkg/DESCR', 'checkdescr', 'Makefile', 'checkmakefile', - 'files/md5', 'TRUE'); + 'pkg/DESCR', 'checkdescr', + 'Makefile', 'checkmakefile'); if ($extrafile) { foreach $i ((<$portdir/scripts/*>, <$portdir/pkg/*>)) { next if (! -T $i); @@ -162,6 +162,12 @@ foreach $i (<$portdir/patches/patch-??>) { push(@checker, $i); $checker{$i} = 'checkpatch'; } +if (-e <$portdir/files/md5>) { + $i = ; + next if (defined $checker{$i}); + push(@checker, $i); + $checker{$i} = 'checkmd5'; +} foreach $i (@checker) { print "OK: checking $i.\n"; if (! -f "$portdir/$i") { @@ -446,6 +452,21 @@ sub checkpatch { close(IN); } +sub checkmd5 { + local($file) = @_; + local($rcsidseen) = 0; + + open(IN, "< $portdir/$file") || return 0; + while () { + $rcsidseen++ if /\$$rcsidstr[:\$]/; + } + if (!$rcsidseen) { + &perror("FATAL: RCS tag \"\$$rcsidstr\$\" must be present ". + "in md5 $file.") + } + close(IN); +} + # # Makefile # -- cgit v1.2.3