summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/Makefile4
-rw-r--r--pkgtools/pkglint/files/pkglint.pl48
2 files changed, 48 insertions, 4 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile
index 64a20c30566..5f66f6cadbe 100644
--- a/pkgtools/pkglint/Makefile
+++ b/pkgtools/pkglint/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.134 2002/08/13 15:05:30 wiz Exp $
+# $NetBSD: Makefile,v 1.135 2002/09/12 17:03:04 wiz Exp $
#
-DISTNAME= pkglint-3.30
+DISTNAME= pkglint-3.31
CATEGORIES= pkgtools devel
MASTER_SITES= # empty
DISTFILES= # empty
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index cb519ca2b4d..ac84d9e12ed 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -12,7 +12,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.68 2002/07/02 15:26:18 wiz Exp $
+# $NetBSD: pkglint.pl,v 1.69 2002/09/12 17:03:04 wiz Exp $
#
# This version contains lots of changes necessary for NetBSD packages
# done by Hubert Feyrer <hubertf@netbsd.org>,
@@ -137,7 +137,10 @@ if ($extrafile) {
next if ($i =~ /Makefile$/);
$i =~ s/^\Q$portdir\E\///;
next if (defined $checker{$i});
- if ($i =~ /PLIST/) {
+ if ($i =~ /MESSAGE/) {
+ unshift(@checker, $i);
+ $checker{$i} = 'checkmessage';
+ } elsif ($i =~ /PLIST/) {
unshift(@checker, $i);
$checker{$i} = 'checkplist';
} else {
@@ -328,6 +331,47 @@ sub checkdistinfo {
}
#
+# MESSAGE
+#
+sub checkmessage {
+ local($file) = @_;
+ local(%maxchars) = ('MESSAGE', 80);
+ local($longlines, $lastline, $tmp) = (0, "", "");
+
+ $shortname = basename($file);
+ open(IN, "< $portdir/$file") || return 0;
+
+ $_ = <IN>;
+ if (! /^={75}$/) {
+ &perror("WARN: $file should begin with a 75-character ".
+ "double-dashed line.");
+ }
+ $_ = <IN>;
+ if (! /^\$NetBSD(:.*|)\$$/) {
+ &perror("FATAL: missing RCS Id in MESSAGE file: $file");
+ }
+ while (<IN>) {
+ $longlines++ if ($maxchars{$shortname} < length($_));
+ $lastline = $_;
+ $tmp .= $_;
+ }
+ if ($lastline !~ /^={75}$/) {
+ &perror("WARN: $file should end with a 75-character ".
+ "double-dashed line.");
+ }
+ if ($longlines > 0) {
+ &perror("WARN: $file includes lines that exceed ".
+ "$maxchars{$shortname} characters.");
+ }
+ if ($tmp =~ /[\033\200-\377]/) {
+ &perror("WARN: $file includes iso-8859-1, or ".
+ "other local characters. $file should be ".
+ "plain ascii file.");
+ }
+ close(IN);
+}
+
+#
# PLIST
#
sub checkplist {