summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authoragc <agc>1998-11-17 17:19:23 +0000
committeragc <agc>1998-11-17 17:19:23 +0000
commit2483e4e98970f4605ca4f6596582de63c297f1ff (patch)
tree81ecccb0cd965bfc8b1b56a5bd50b67fd8ba9c31 /pkgtools
parent981f51f8b418631451abfe3d845c8ffe391cba3d (diff)
downloadpkgsrc-2483e4e98970f4605ca4f6596582de63c297f1ff.tar.gz
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.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/files/pkglint.pl29
1 files changed, 25 insertions, 4 deletions
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 <hubertf@netbsd.org> 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 = <files/md5>;
+ 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 (<IN>) {
+ $rcsidseen++ if /\$$rcsidstr[:\$]/;
+ }
+ if (!$rcsidseen) {
+ &perror("FATAL: RCS tag \"\$$rcsidstr\$\" must be present ".
+ "in md5 $file.")
+ }
+ close(IN);
+}
+
#
# Makefile
#