head 1.5; access; symbols pkgsrc-2013Q2:1.5.0.54 pkgsrc-2013Q2-base:1.5 pkgsrc-2012Q4:1.5.0.52 pkgsrc-2012Q4-base:1.5 pkgsrc-2011Q4:1.5.0.50 pkgsrc-2011Q4-base:1.5 pkgsrc-2011Q2:1.5.0.48 pkgsrc-2011Q2-base:1.5 pkgsrc-2009Q4:1.5.0.46 pkgsrc-2009Q4-base:1.5 pkgsrc-2008Q4:1.5.0.44 pkgsrc-2008Q4-base:1.5 pkgsrc-2008Q3:1.5.0.42 pkgsrc-2008Q3-base:1.5 cube-native-xorg:1.5.0.40 cube-native-xorg-base:1.5 pkgsrc-2008Q2:1.5.0.38 pkgsrc-2008Q2-base:1.5 pkgsrc-2008Q1:1.5.0.36 pkgsrc-2008Q1-base:1.5 pkgsrc-2007Q4:1.5.0.34 pkgsrc-2007Q4-base:1.5 pkgsrc-2007Q3:1.5.0.32 pkgsrc-2007Q3-base:1.5 pkgsrc-2007Q2:1.5.0.30 pkgsrc-2007Q2-base:1.5 pkgsrc-2007Q1:1.5.0.28 pkgsrc-2007Q1-base:1.5 pkgsrc-2006Q4:1.5.0.26 pkgsrc-2006Q4-base:1.5 pkgsrc-2006Q3:1.5.0.24 pkgsrc-2006Q3-base:1.5 pkgsrc-2006Q2:1.5.0.22 pkgsrc-2006Q2-base:1.5 pkgsrc-2006Q1:1.5.0.20 pkgsrc-2006Q1-base:1.5 pkgsrc-2005Q4:1.5.0.18 pkgsrc-2005Q4-base:1.5 pkgsrc-2005Q3:1.5.0.16 pkgsrc-2005Q3-base:1.5 pkgsrc-2005Q2:1.5.0.14 pkgsrc-2005Q2-base:1.5 pkgsrc-2005Q1:1.5.0.12 pkgsrc-2005Q1-base:1.5 pkgsrc-2004Q4:1.5.0.10 pkgsrc-2004Q4-base:1.5 pkgsrc-2004Q3:1.5.0.8 pkgsrc-2004Q3-base:1.5 pkgsrc-2004Q2:1.5.0.6 pkgsrc-2004Q2-base:1.5 pkgsrc-2004Q1:1.5.0.4 pkgsrc-2004Q1-base:1.5 pkgsrc-2003Q4:1.5.0.2 pkgsrc-2003Q4-base:1.5 buildlink2-base:1.5 netbsd-1-3-PATCH002:1.2; locks; strict; comment @# @; 1.5 date 98.08.07.22.25.35; author tsarna; state dead; branches; next 1.4; 1.4 date 98.08.07.10.40.27; author agc; state Exp; branches; next 1.3; 1.3 date 98.07.15.10.37.33; author frueauf; state Exp; branches; next 1.2; 1.2 date 98.04.28.14.57.44; author frueauf; state Exp; branches; next 1.1; 1.1 date 98.04.25.13.23.35; author frueauf; state Exp; branches; next ; desc @@ 1.5 log @Portlint is dead, long live pkglint @ text @$NetBSD: patch-aa,v 1.4 1998/08/07 10:40:27 agc Exp $ --- portlint.pl.orig Wed Jul 15 11:43:04 1998 +++ portlint.pl Wed Jul 15 12:00:43 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.4 1998/08/07 10:40:27 agc Exp $ # +# This version contains some changes necessary for NetBSD packages +# done by Hubert Feyrer and +# Thorsten Frueauf +# $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/, <, <$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 () { $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 () { - 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", < PLIST. This is done automatically now. @ text @d1 2 d13 1 a13 1 # $Id: portlint.pl,v 1.64 1998/02/28 02:34:05 itojun Exp $ @ 1.2 log @Check MAN* consistency only if flag "-a" is set, problem noted by Tron. @ text @d1 2 a2 2 --- portlint.pl.orig Tue Apr 28 16:20:01 1998 +++ portlint.pl Tue Apr 28 16:28:06 1998 d448 1 a448 1 + if ($extrafile) { @ 1.1 log @Initial import of portlint-1.64 (+ NetBSD changes). @ text @d1 2 a2 2 --- portlint.pl-orig Sat Apr 25 13:19:25 1998 +++ portlint.pl Sat Apr 25 13:32:53 1998 d288 1 a288 1 } d299 1 a299 1 + } d434 39 a472 8 @@@@ -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."); d474 45 d520 15 a534 6 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 @@@@ @