summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2001-02-16 13:06:17 +0000
committerwiz <wiz@pkgsrc.org>2001-02-16 13:06:17 +0000
commit1b7f0d246f2f256fabb26f4b3db46a119b6f5945 (patch)
treed451a3db8b4e988109ec4e1b267be49694da109b /pkgtools
parent45e53b4367cab19f9f887bf001681852885d668e (diff)
downloadpkgsrc-1b7f0d246f2f256fabb26f4b3db46a119b6f5945.tar.gz
Change COMMENT handling:
COMMENTs are now a variable in the Makefile instead of a pkg/COMMENT file. The COMMENT var should be in the maintainer block after the homepage. Modify bsd.pkg.mk, pkglint, url2pkg, and port2pkg (last one untested) for the new behaviour. Document new state in Packages.txt. This should save lots of inodes, and lots of time when untarring/updating. Idea by Alistair Crooks. For the time being, accept pkg/COMMENT instead of a COMMENT var to avoid a flag day.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/Makefile4
-rw-r--r--pkgtools/pkglint/files/pkglint.pl53
-rw-r--r--pkgtools/port2pkg/Makefile4
-rwxr-xr-xpkgtools/port2pkg/files/port2pkg.pl10
-rw-r--r--pkgtools/url2pkg/Makefile4
-rwxr-xr-xpkgtools/url2pkg/files/url2pkg8
6 files changed, 45 insertions, 38 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile
index 405ffb84639..492bcbd1bf2 100644
--- a/pkgtools/pkglint/Makefile
+++ b/pkgtools/pkglint/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.77 2001/01/29 10:48:09 abs Exp $
+# $NetBSD: Makefile,v 1.78 2001/02/16 13:06:19 wiz Exp $
#
-DISTNAME= pkglint-2.36
+DISTNAME= pkglint-2.37
CATEGORIES= pkgtools devel
MASTER_SITES= # empty
DISTFILES= # empty
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index b64a83042ae..96def7e1c0b 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.38 2001/01/26 13:16:52 wiz Exp $
+# $NetBSD: pkglint.pl,v 1.39 2001/02/16 13:06:19 wiz Exp $
#
# This version contains some changes necessary for NetBSD packages
# done by Hubert Feyrer <hubertf@netbsd.org> and
@@ -158,9 +158,8 @@ if (! -f "$portdir/Makefile") {
#
# check for files.
#
-@checker = ("$pkgdir/COMMENT", "$pkgdir/DESCR");
-%checker = ("$pkgdir/COMMENT", 'checkdescr',
- "$pkgdir/DESCR", 'checkdescr');
+@checker = ("$pkgdir/DESCR");
+%checker = ("$pkgdir/DESCR", 'checkdescr');
if ($extrafile) {
foreach $i ((<$portdir/$scriptdir/*>, <$portdir/$pkgdir/*>)) {
@@ -232,6 +231,9 @@ if (-e <$portdir/$md5file> ) {
&perror("WARN: no $portdir/$md5file file. Please run 'make makesum'.");
}
}
+if (-e <$pkgdir/COMMENT> ) {
+ &perror("FATAL: pkg/COMMENT is deprecated -- please use a COMMENT variable instead.");
+}
if (! -f "$portdir/$pkgdir/PLIST"
and ! -f "$portdir/$pkgdir/PLIST-mi"
and ! $seen_PLIST_SRC
@@ -261,14 +263,13 @@ if ($err || $warn) {
exit $err;
#
-# pkg/COMMENT, pkg/DESCR
+# pkg/DESCR
#
sub checkdescr {
local($file) = @_;
- local(%maxchars) = ('COMMENT', 70, 'DESCR', 80);
- local(%maxlines) = ('COMMENT', 1, 'DESCR', 24);
- local(%errmsg) = ('COMMENT', "must be one-liner",
- 'DESCR', "exceeds $maxlines{'DESCR'} ".
+ local(%maxchars) = ('DESCR', 80);
+ local(%maxlines) = ('DESCR', 24);
+ local(%errmsg) = ('DESCR', "exceeds $maxlines{'DESCR'} ".
"lines, make it shorter if possible");
local($longlines, $linecnt, $tmp) = (0, 0, "");
@@ -295,19 +296,6 @@ sub checkdescr {
"other local characters. $file should be ".
"plain ascii file.");
}
- if ($shortname eq 'COMMENT') {
- if ($tmp =~ /\.$/i) {
- &perror("WARN: $file should not end with".
- " a '.' (period).");
- }
- if ($tmp =~ /^(a|an) /i) {
- &perror("WARN: $file should not begin with '$1 '.");
- }
- if ($tmp =~ /^\s/ || $tmp =~ /\s\n$/) {
- &perror("WARN: $file should not not have any leading".
- " or trailing whitespace.");
- }
- }
close(IN);
}
@@ -651,7 +639,7 @@ sub readmakefile {
sub checkmakefile {
local($file) = @_;
local($rawwhole, $whole, $idx, @sections);
- local($tmp);
+ local($tmp, $tmp2);
local($i, $j, $k, $l);
local(@varnames) = ();
local($distfiles, $pkgname, $distname, $extractsufx) = ('', '', '', '');
@@ -1137,9 +1125,9 @@ EOF
@tocheck=split(/\s+/, <<EOF);
MAINTAINER
EOF
- if ($osname eq "NetBSD") {
- push(@tocheck,"HOMEPAGE");
- }
+ push(@tocheck,"HOMEPAGE");
+ push(@tocheck,"COMMENT");
+
&checkorder('MAINTAINER', $tmp, @tocheck);
# warnings for missing HOMEPAGE
@@ -1148,6 +1136,19 @@ EOF
&perror("WARN: please add HOMEPAGE if the package has one.");
}
+ # warnings for missing COMMENT
+ if ($tmp !~ /\nCOMMENT=\s*(.*)$/) {
+ &perror("FATAL: please add a short COMMENT describing the package.");
+ }
+ # and its properties:
+ $tmp2 = $1;
+ if ($tmp2 =~ /\.$/i) {
+ &perror("WARN: COMMENT should not end with a '.' (period).");
+ }
+ if ($tmp2 =~ /^(a|an) /i) {
+ &perror("WARN: COMMENT should not begin with '$1 '.");
+ }
+
&checkearlier($tmp, @varnames);
$tmp = "\n" . $tmp;
if ($tmp =~ /\nMAINTAINER=[^\n]+/) {
diff --git a/pkgtools/port2pkg/Makefile b/pkgtools/port2pkg/Makefile
index 259d01bb3c4..8ad6e3fbbed 100644
--- a/pkgtools/port2pkg/Makefile
+++ b/pkgtools/port2pkg/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.9 2001/01/04 20:22:47 sommerfeld Exp $
+# $NetBSD: Makefile,v 1.10 2001/02/16 13:06:20 wiz Exp $
#
-DISTNAME= port2pkg-1.7
+DISTNAME= port2pkg-1.8
CATEGORIES= pkgtools
MASTER_SITES= # empty
DISTFILES= # empty
diff --git a/pkgtools/port2pkg/files/port2pkg.pl b/pkgtools/port2pkg/files/port2pkg.pl
index 549bb57c876..e1914421258 100755
--- a/pkgtools/port2pkg/files/port2pkg.pl
+++ b/pkgtools/port2pkg/files/port2pkg.pl
@@ -1,6 +1,6 @@
#!/usr/bin/env perl
#
-# $NetBSD: port2pkg.pl,v 1.7 2001/01/04 20:22:47 sommerfeld Exp $
+# $NetBSD: port2pkg.pl,v 1.8 2001/02/16 13:06:20 wiz Exp $
#
require 'getopts.pl';
@@ -239,6 +239,14 @@ sub conv_Makefile {
}
}
close(DESCR);
+ open(COMMENT, "$pkgdir/pkg/COMMENT")
+ || die "$pkgdir/pkg/COMMENT: $!\n";
+ while (<COMMENT>) {
+ chomp;
+ print PKG "COMMENT=\t$1\n";
+ }
+ close(COMMENT);
+ unlink("$pkgdir/pkg/COMMENT");
} elsif ($noportdocs || /^\.if.*NOPORTDOCS/) {
if (/^\.if/) {
$noportdocs++;
diff --git a/pkgtools/url2pkg/Makefile b/pkgtools/url2pkg/Makefile
index 4e7c66459c9..94b0d1824f4 100644
--- a/pkgtools/url2pkg/Makefile
+++ b/pkgtools/url2pkg/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.11 2001/01/29 09:57:41 abs Exp $
+# $NetBSD: Makefile,v 1.12 2001/02/16 13:06:19 wiz Exp $
#
-DISTNAME= url2pkg-1.14
+DISTNAME= url2pkg-1.15
CATEGORIES= pkgtools sysutils
MASTER_SITES= # Nothing
DISTFILES= # Nothing
diff --git a/pkgtools/url2pkg/files/url2pkg b/pkgtools/url2pkg/files/url2pkg
index 85cfa84924c..6c56af5e948 100755
--- a/pkgtools/url2pkg/files/url2pkg
+++ b/pkgtools/url2pkg/files/url2pkg
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: url2pkg,v 1.14 2001/01/28 17:30:20 hubertf Exp $
+# $NetBSD: url2pkg,v 1.15 2001/02/16 13:06:20 wiz Exp $
#
# url2pkg
# (c) 1999 Hubert Feyrer
@@ -74,6 +74,7 @@ if [ ! -f w*/.extract_done ]; then
echo ""
echo "MAINTAINER= $email_maintainer"
echo "HOMEPAGE= "
+ echo "COMMENT= <SHORT_DESCRIPTION_OF_THE_PACKAGE>"
echo ""
echo '.include "../../mk/bsd.pkg.mk"'
) >Makefile
@@ -133,13 +134,10 @@ echo ""
echo "Contents of "`echo w*`"/${wrksrc}:"
ls -la w*/$wrksrc
-if [ ! -f pkg/COMMENT ]; then
- touch pkg/COMMENT
-fi
if [ ! -f pkg/DESCR ]; then
touch pkg/DESCR
fi
echo ""
-echo "Don't forget to fill in pkg/COMMENT and pkg/DESCR when you're done."
+echo "Don't forget to fill in the COMMENT variable and pkg/DESCR when you're done."
echo ""
echo "Good luck! (See pkgsrc/Packages.txt for some more help :-)"