summaryrefslogtreecommitdiff
path: root/devel/portlint/patches/patch-aa
diff options
context:
space:
mode:
Diffstat (limited to 'devel/portlint/patches/patch-aa')
-rw-r--r--devel/portlint/patches/patch-aa457
1 files changed, 457 insertions, 0 deletions
diff --git a/devel/portlint/patches/patch-aa b/devel/portlint/patches/patch-aa
new file mode 100644
index 00000000000..92ea77b0d2e
--- /dev/null
+++ b/devel/portlint/patches/patch-aa
@@ -0,0 +1,457 @@
+--- portlint.pl-orig Sat Apr 25 13:19:25 1998
++++ portlint.pl Sat Apr 25 13:32:53 1998
+@@ -1,4 +1,4 @@
+-#! /usr/bin/perl
++#!@PREFIX@/bin/perl
+ #
+ # portlint - lint for port directory
+ # implemented by:
+@@ -12,6 +12,10 @@
+ #
+ # $Id: patch-aa,v 1.1 1998/04/25 13:23:35 frueauf Exp $
+ #
++# This version contains some changes necessary for NetBSD packages
++# done by Hubert Feyrer <hubertf@netbsd.org> and
++# Thorsten Frueauf <frueauf@netbsd.org>
++#
+
+ $err = $warn = 0;
+ $extrafile = $parenwarn = $committer = $verbose = $newport = 0;
+@@ -27,6 +31,7 @@
+ $mancompress = 1;
+ $manstrict = 0;
+ $manchapters = '123456789ln';
++$localbase = "/usr/local";
+
+ #select(STDERR);
+ while (@ARGV > 0) {
+@@ -62,10 +67,10 @@
+ }
+
+ # OS dependent configs
+-# os portsdir rcsid mplist ldcfg plist-rcsid mancompresss strict
++# os portsdir rcsid mplist ldcfg plist-rcsid mancompresss strict localbase
+ @osdep = split(/\n/, <<EOF);
+-FreeBSD /usr/ports Id 0 0 0 1 0
+-NetBSD /usr/pkgsrc NetBSD 1 1 1 0 1
++FreeBSD /usr/ports Id 0 0 0 1 0 /usr/local
++NetBSD @PORTSDIR@ NetBSD 1 1 1 0 1 @PREFIX@
+ EOF
+ $osname = `uname -s`;
+ $osname =~ s/\n$//;
+@@ -73,7 +78,7 @@
+ if ($i =~ /^$osname\t(.*)/) {
+ print "OK: found OS config for $osname.\n" if ($verbose);
+ ($portsdir, $rcsidstr, $multiplist, $ldconfigwithtrue,
+- $rcsidinplist, $mancompress, $manstrict)
++ $rcsidinplist, $mancompress, $manstrict, $localbase)
+ = split(/\t+/, $1);
+ last;
+ }
+@@ -85,7 +90,8 @@
+ "ldconfigwithtrue: $ldconfigwithtrue ".
+ "rcsidinplist: $rcsidinplist ".
+ "mancompress: $mancompress ".
+- "manstrict: $manstrict\n";
++ "manstrict: $manstrict ".
++ "localbase: $localbase\n";
+ }
+
+ #
+@@ -129,26 +135,28 @@
+ #
+ # check for files.
+ #
+-@checker = ('pkg/PLIST', 'pkg/COMMENT', 'pkg/DESCR', 'Makefile', 'files/md5');
+-%checker = ('pkg/PLIST', 'checkplist', 'pkg/COMMENT', 'checkdescr',
++@checker = ('pkg/COMMENT', 'pkg/DESCR', 'Makefile', 'files/md5');
++%checker = ('pkg/COMMENT', 'checkdescr',
+ 'pkg/DESCR', 'checkdescr', 'Makefile', 'checkmakefile',
+ 'files/md5', 'TRUE');
+ if ($extrafile) {
+ foreach $i ((<$portdir/scripts/*>, <$portdir/pkg/*>)) {
+ next if (! -T $i);
+- $i =~ s/^$portdir\///;
++ $i =~ s/^\Q$portdir\E\///;
+ next if (defined $checker{$i});
+- push(@checker, $i);
+- if ($multiplist && $i =~ /pkg\/PLIST/) {
++ if ($i =~ /pkg\/PLIST$/ ||
++ ($multiplist && $i =~ /pkg\/PLIST/)) {
++ unshift(@checker, $i);
+ $checker{$i} = 'checkplist';
+ } else {
++ push(@checker, $i);
+ $checker{$i} = 'checkpathname';
+ }
+ }
+ }
+ foreach $i (<$portdir/patches/patch-??>) {
+ next if (! -T $i);
+- $i =~ s/^$portdir\///;
++ $i =~ s/^\Q$portdir\E\///;
+ next if (defined $checker{$i});
+ push(@checker, $i);
+ $checker{$i} = 'checkpatch';
+@@ -229,7 +237,7 @@
+ #
+ sub checkplist {
+ local($file) = @_;
+- local($curdir) = ('/usr/local'); # XXX
++ local($curdir) = ($localbase);
+ local($inforemoveseen, $infoinstallseen, $infoseen) = (0, 0, 0);
+ local($infobeforeremove, $infoafterinstall) = (0, 0);
+ local($infooverwrite) = (0);
+@@ -246,16 +254,26 @@
+ $_ =~ s/\s+$//;
+
+ $_ =~ s/\n$//;
++
++ if (($osname eq "NetBSD") && ($_ =~ /<\$ARCH>/)) {
++ &perror("WARN: $file $.: use of <\$ARCH> ".
++ "deprecated, use \${MACHINE_ARCH instead}.");
++ }
++
+ if ($_ =~ /^\@/) {
+ if ($_ =~ /^\@(cwd|cd)[ \t]+(\S+)/) {
+ $curdir = $2;
+ } elsif ($_ =~ /^\@unexec[ \t]+rmdir/) {
+ &perror("WARN: use \"\@dirrm\" ".
+ "instead of \"\@unexec rmdir\".");
+- } elsif ($_ =~ /^\@exec[ \t]+install-info/) {
+- $infoinstallseen = $.;
+- } elsif ($_ =~ /^\@unexec[ \t]+install-info[ \t]+--delete/) {
+- $inforemoveseen = $.;
++ } elsif ($_ =~ /^\@exec[ \t]+(.*\/)?install-info/) {
++ $infoinstallseen = $.
++ if (($osname ne "NetBSD") || ("$1" eq "%D/bin/"));
++ # On NetBSD, we enforce %D/bin/...
++ } elsif ($_ =~ /^\@unexec[ \t]+(.*\/)?install-info[ \t]+--delete/) {
++ $inforemoveseen = $.
++ if (($osname ne "NetBSD") || ("$1" eq "%D/bin/"));
++ # On NetBSD, we enforce %D/bin/...
+ } elsif ($_ =~ /^\@(exec|unexec)/) {
+ if ($ldconfigwithtrue
+ && /ldconfig/
+@@ -293,37 +311,39 @@
+ $infooverwrite++;
+ }
+
+- if ($_ =~ m#man/([^/]+/)?man([$manchapters])/([^\.]+\.[$manchapters])(\.gz)?$#) {
+- if ($4 eq '') {
+- $plistman{$2} .= ' ' . $3;
+- if ($mancompress) {
+- &perror("FATAL: $file $.: ".
+- "unpacked man file $3 ".
+- "listed. must be gzipped.");
+- }
+- } else {
+- $plistmangz{$2} .= ' ' . $3;
+- if (!$mancompress) {
+- &perror("FATAL: $file $.: ".
+- "gzipped man file $3$4 ".
+- "listed. unpacked one should ".
+- "be installed.");
+- }
+- }
++ if ($_ =~ m#man/([^/]+/)?man([$manchapters])/(.+\.[$manchapters])(\.gz)?#) { # was bugg for manpages w/ . in name - HF
++ if ($osname eq "FreeBSD") {
++ if ($4 eq '') {
++ $plistman{$2} .= ' ' . $3;
++ if ($mancompress) {
++ &perror("FATAL: $file $.: ".
++ "unpacked man file $3 ".
++ "listed. must be gzipped.");
++ }
++ } else {
++ $plistmangz{$2} .= ' ' . $3;
++ if (!$mancompress) {
++ &perror("FATAL: $file $.: ".
++ "gzipped man file $3$4 ".
++ "listed. unpacked one should ".
++ "be installed.");
++ }
++ }
++ }
+ $plistmanall{$2} .= ' ' . $3;
+ if ($1 ne '') {
+ $manlangs{substr($1, 0, length($1) - 1)}++;
+ }
+ }
+
+- if ($curdir !~ m#^/usr/local#
++ if ($curdir !~ m#^$localbase#
+ && $curdir !~ m#^/usr/X11R6#) {
+ &perror("WARN: $file $.: installing to ".
+ "directory $curdir discouraged. ".
+ "could you please avoid it?");
+ }
+
+- if ("$curdir/$_" =~ m#^/usr/local/share/doc#) {
++ if ("$curdir/$_" =~ m#^$localbase/share/doc#) {
+ print "OK: seen installation to share/doc in $file. ".
+ "($curdir/$_)\n" if ($verbose);
+ $sharedocused++;
+@@ -341,21 +361,21 @@
+ }
+ if (!$infoinstallseen) {
+ if ($infooverwrite) {
+- &perror("FATAL: install-info must be used to ".
++ &perror("FATAL: \"\@exec ".(($osname eq "NetBSD")?"%D/bin/":"")."install-info must be used to ".
+ "add/delete entries into \"info/dir\".");
+ }
+- &perror("FATAL: \"\@exec install-info\" must be placed ".
++ &perror("FATAL: \"\@exec ".(($osname eq "NetBSD")?"%D/bin/":"")."install-info\" must be placed ".
+ "after all the info files.");
+ } elsif ($infoafterinstall) {
+- &perror("FATAL: move \"\@exec install-info\" line to make ".
++ &perror("FATAL: move \"\@exec ".(($osname eq "NetBSD")?"%D/bin/":"")."install-info\" line to make ".
+ "sure that it is placed after all the info files. ".
+ "(currently on line $infoinstallseen in $file)");
+ }
+ if (!$inforemoveseen) {
+- &perror("FATAL: \"\@unexec install-info --delete\" must ".
++ &perror("FATAL: \"\@unexec ".(($osname eq "NetBSD")?"%D/bin/":"")."install-info --delete\" must ".
+ "be placed before any of the info files listed.");
+ } elsif ($infobeforeremove) {
+- &perror("FATAL: move \"\@exec install-info --delete\" ".
++ &perror("FATAL: move \"\@exec ".(($osname eq "NetBSD")?"%D/bin/":"")."install-info --delete\" ".
+ "line to make sure ".
+ "that it is placed before any of the info files. ".
+ "(currently on line $inforemoveseen in $file)");
+@@ -409,7 +429,10 @@
+ while (<IN>) {
+ $whole .= $_;
+ }
+- if ($committer && $whole =~ /\$([A-Za-z0-9]+)[:\$]/) {
++ if ($committer && $whole =~ /.\$([A-Za-z0-9]+)[:\$]/) { # XXX
++ # RCS ID in very first line is ok, to identify version
++ # of patch (-> only warn if there's something before the
++ # actual $RCS_ID$, not on BOF - '.' won't match there)
+ &perror("WARN: $file includes possible RCS tag \"\$$1\$\". ".
+ "use binary mode (-ko) on commit/import.");
+ }
+@@ -435,7 +458,7 @@
+ $rawwhole = '';
+ $tmp = 0;
+ while (<IN>) {
+- if ($_ =~ /[ \t]+\n?$/) {
++ if ($_ =~ /[ \t]+\n?$/ && !/^#/) {
+ &perror("WARN: $file $.: whitespace before ".
+ "end of line.");
+ }
+@@ -514,9 +537,10 @@
+ }
+ print "OK: checking for use of NOPORTDOCS.\n" if ($verbose);
+ if ($sharedocused && $whole !~ /defined\(NOPORTDOCS\)/
+- && $whole !~ m#(\$[\{\(]PREFIX[\}\)]|/usr/local)/share/doc#) {
++ && $whole !~ m#(\$[\{\(]PREFIX[\}\)]|$localbase)/share/doc#) {
+ &perror("WARN: use \".if !defined(NOPORTDOCS)\" to wrap ".
+- "installation of files into /usr/local/share/doc.");
++ "installation of files into $localbase/share/doc.")
++ if $osname ne "NetBSD"; # how do you get this out of PLIST?
+ }
+
+ #
+@@ -581,30 +605,36 @@
+ # section 1: comment lines.
+ #
+ print "OK: checking comment section of $file.\n" if ($verbose);
+- @linestocheck = split("\n", <<EOF);
++ if($osname ne "NetBSD"){
++ @linestocheck = split("\n", <<EOF);
+ Whom
+ Version [rR]equired
+ Date [cC]reated
+-(New )?[pP]orts [cC]ollection [mM]akefile [fF]or
+ EOF
+- $tmp = $sections[$idx++];
+- $tmp = "\n" . $tmp; # to make the begin-of-line check easier
++ unshift(@linestocheck,'(New )?[pP]orts [cC]ollection [mM]akefile [fF]or');
++ $tmp = $sections[$idx++];
++ $tmp = "\n" . $tmp; # to make the begin-of-line check easier
+
+- if ($tmp =~ /\n[^#]/) {
+- &perror("FATAL: non-comment line in comment section of $file.");
+- }
+- foreach $i (@linestocheck) {
+- $j = $i;
+- $j =~ s/\(.*\)\?//g;
+- $j =~ s/\[(.)[^\]]*\]/$1/g;
+- if ($tmp !~ /# $i:[ \t]+\S+/) {
+- &perror("FATAL: no \"$j\" line in ".
+- "comment section of $file.");
+- } else {
+- print "OK: \"$j\" seen in $file.\n" if ($verbose);
++ if ($tmp =~ /\n[^#]/) {
++ &perror("FATAL: non-comment line in comment section of $file.");
+ }
++ foreach $i (@linestocheck) {
++ $j = $i;
++ $j =~ s/\(.*\)\?//g;
++ $j =~ s/\[(.)[^\]]*\]/$1/g;
++ if ($tmp !~ /# $i:[ \t]+\S+/) {
++ &perror("FATAL: no \"$j\" line in ".
++ "comment section of $file.");
++ } else {
++ print "OK: \"$j\" seen in $file.\n" if ($verbose);
++ }
++ }
++ } else {
++ $tmp = $sections[$idx++];
+ }
+- if ($tmp !~ /#\n#(\s+)\$$rcsidstr([^\$]*)\$\n/) {
++ if ((($tmp !~ /#(\s+)\$$rcsidstr([^\$]*)\$/) && ($osname eq "NetBSD"))
++ || (($tmp !~ /#\n#(\s+)\$$rcsidstr([^\$]*)\$/) &&
++ ($osname eq "FreeBSD"))) {
+ &perror("FATAL: no \$$rcsidstr\$ line in $file comment ".
+ "section.");
+ } else {
+@@ -642,10 +672,15 @@
+ $tmp = $sections[$idx++];
+
+ # check the order of items.
+- &checkorder('DISTNAME', $tmp, split(/\s+/, <<EOF));
+-DISTNAME PKGNAME CATEGORIES MASTER_SITES MASTER_SITE_SUBDIR
++ @tocheck=split(/\s+/, <<EOF);
++DISTNAME PKGNAME WRKSRC NO_WRKSUBDIR CATEGORIES MASTER_SITES MASTER_SITE_SUBDIR
+ EXTRACT_SUFX DISTFILES
+ EOF
++ if ($osname eq "NetBSD") {
++ push(@tocheck,"ONLY_FOR_ARCHS");
++ push(@tocheck,"MIRROR_DISTFILES");
++ }
++ &checkorder('DISTNAME', $tmp, @tocheck);
+
+ # check the items that has to be there.
+ $tmp = "\n" . $tmp;
+@@ -671,7 +706,7 @@
+ &perror("FATAL: URL \"$i\" should ".
+ "end with \"/\".");
+ }
+- if ($i =~ m#://[^/]*:/$#) {
++ if ($i =~ m#://[^/]*:/#) {
+ &perror("FATAL: URL \"$i\" contains ".
+ "extra \":\".");
+ }
+@@ -721,7 +756,7 @@
+ $j = $`;
+ $k = $1;
+ if ($j =~ /[0-9]$/) {
+- &perror("WARN: is \"$j\" seems sane as package name ".
++ &perror("WARN: is \"$j\" sane as package name ".
+ "WITHOUT version number? ".
+ "if not, avoid \"-\" in version number ".
+ "part of ".
+@@ -736,8 +771,8 @@
+ (($pkgname eq '')
+ ? ', which is derived from DISTNAME, '
+ : ' ').
+- "looks illegal. should modify \"-$k\" to ".
+- "obey the handbook.");
++ "looks illegal. should modify \"-$k\"" .
++ ($osname ne "NetBSD"?" to obey the handbook.":"."));
+ }
+ } else {
+ &perror("FATAL: PKGNAME".
+@@ -806,13 +841,17 @@
+ if ($verbose);
+ $tmp = $sections[$idx];
+
+- if ($tmp =~ /(PATCH_SITES|PATCHFILES|PATCH_DIST_STRIP)/) {
++ if ($tmp =~ /(PATCH_SITES|PATCH_SITE_SUBDIR|PATCHFILES|PATCH_DIST_STRIP)/) {
+ &checkearlier($tmp, @varnames);
+
+ if ($tmp =~ /^PATCH_SITES=/) {
+ print "OK: seen PATCH_SITES.\n" if ($verbose);
+ $tmp =~ s/^[^\n]+\n//;
+ }
++ if ($tmp =~ /^PATCH_SITE_SUBDIR=/) {
++ print "OK: seen PATCH_SITES.\n" if ($verbose);
++ $tmp =~ s/^[^\n]+\n//;
++ }
+ if ($tmp =~ /^PATCHFILES=/) {
+ print "OK: seen PATCHFILES.\n" if ($verbose);
+ $tmp =~ s/^[^\n]+\n//;
+@@ -844,6 +883,7 @@
+ $tmp =~ s/\nMAINTAINER=[^\n]+//;
+ } else {
+ &perror("FATAL: no MAINTAINER listed in $file.");
++ # Why is this fatal? There's a default in bsd.port.mk - HF
+ }
+ $tmp =~ s/\n\n+/\n/g;
+
+@@ -862,6 +902,8 @@
+ @linestocheck = split(/\s+/, <<EOF);
+ LIB_DEPENDS BUILD_DEPENDS RUN_DEPENDS FETCH_DEPENDS DEPENDS DEPENDS_TARGET
+ EOF
++ $warn_lib_depends_backslashes=0
++ if $osname eq "NetBSD";
+ if ($tmp =~ /(LIB_|BUILD_|RUN_|FETCH_)?DEPENDS/) {
+ &checkearlier($tmp, @varnames);
+
+@@ -888,10 +930,20 @@
+ "listed in $j. consider using ".
+ "USE_GMAKE.");
+ }
++ # check for LIB_DEPENDS w/o backslashes
++ if ($osname eq "NetBSD") {
++ if (("$j" eq "LIB_DEPENDS") && ($l =~ /\\\\\./)) {
++ $warn_lib_depends_backslashes=1;
++ }
++ }
+
+ # check port dir existence
+ $k = (split(':', $k))[1];
+- $k =~ s/\${PORTSDIR}/$ENV{'PORTSDIR'}/;
++ if ($osname eq "NetBSD") {
++ $k =~ s/..\/../$ENV{'PORTSDIR'}/;
++ } else {
++ $k =~ s/\${PORTSDIR}/$ENV{'PORTSDIR'}/;
++ }
+ if (! -d $k) {
+ &perror("WARN: no port directory $k ".
+ "found, even though it is ".
+@@ -902,6 +954,9 @@
+ }
+ }
+ }
++ if (($osname eq "NetBSD") && ($warn_lib_depends_backslashes == 1)) {
++ &perror("WARN: use of backslashes in LIB_DEPENDS is deprecated.");
++ }
+ foreach $i (@linestocheck) {
+ $tmp =~ s/$i[?+]?=[^\n]+\n//g;
+ }
+@@ -963,7 +1018,7 @@
+ if ($distname ne '' && $wrksrc eq '') {
+ &perror("WARN: do not use DISTFILES and DISTNAME ".
+ "to control WRKSRC. how about ".
+- ".\"WRKSRC=\${WRKDIR}/$distname\"?");
++ "\"WRKSRC=\${WRKDIR}/$distname\"?");
+ } else {
+ &perror("WARN: DISTFILES/DISTNAME affects WRKSRC. ".
+ "take caution when changing them.");
+@@ -993,12 +1048,14 @@
+ @mman = split(/\s+/, $1);
+ @pman = split(/\s+/, $plistmanall{$i});
+ foreach $j (@mman) {
++ next if ($j eq '');
+ if (!grep($_ eq $j, @pman)) {
+ &perror("WARN: manpage $j in $file ".
+ "MAN$i but not in PLIST.");
+ }
+ }
+ foreach $j (@pman) {
++ next if ($j eq '');
+ if (!grep($_ eq $j, @mman)) {
+ &perror("WARN: manpage $j in PLIST ".
+ "but not in $file MAN$i.");
+@@ -1169,7 +1226,7 @@
+ %cmdnames = split(/\n|\t+/, <<EOF);
+ /usr/opt \${PORTSDIR} instead
+ $portsdir \${PORTSDIR} instead
+-/usr/local \${PREFIX} or \${LOCALBASE}, as appropriate
++$localbase \${PREFIX} or \${LOCALBASE}, as appropriate
+ /usr/X11 \${PREFIX} or \${X11BASE}, as appropriate
+ EOF
+ foreach $i (keys %cmdnames) {