diff options
author | frueauf <frueauf@pkgsrc.org> | 1998-04-25 13:23:35 +0000 |
---|---|---|
committer | frueauf <frueauf@pkgsrc.org> | 1998-04-25 13:23:35 +0000 |
commit | 1fab69c425dc284f5106b45878158bc2d12180b7 (patch) | |
tree | a755883cd9c3dbe9493b4be5e432b6da12ef0828 /devel | |
parent | 650398e0cf46a5b9ca1da459322f96e52b3127de (diff) | |
download | pkgsrc-1fab69c425dc284f5106b45878158bc2d12180b7.tar.gz |
Initial import of portlint-1.64 (+ NetBSD changes).
Diffstat (limited to 'devel')
-rw-r--r-- | devel/portlint/Makefile | 42 | ||||
-rw-r--r-- | devel/portlint/files/md5 | 1 | ||||
-rw-r--r-- | devel/portlint/patches/patch-aa | 457 | ||||
-rw-r--r-- | devel/portlint/patches/patch-ab | 33 | ||||
-rw-r--r-- | devel/portlint/patches/patch-ac | 99 | ||||
-rw-r--r-- | devel/portlint/patches/patch-ad | 20 | ||||
-rw-r--r-- | devel/portlint/pkg/COMMENT | 1 | ||||
-rw-r--r-- | devel/portlint/pkg/DESCR | 10 | ||||
-rw-r--r-- | devel/portlint/pkg/PLIST | 5 |
9 files changed, 668 insertions, 0 deletions
diff --git a/devel/portlint/Makefile b/devel/portlint/Makefile new file mode 100644 index 00000000000..7dc505f3c34 --- /dev/null +++ b/devel/portlint/Makefile @@ -0,0 +1,42 @@ +# $NetBSD: Makefile,v 1.1 1998/04/25 13:23:35 frueauf Exp $ +# + +DISTNAME= portlint-1.64 +CATEGORIES= devel +MASTER_SITES= ftp://ftp.foretune.co.jp/pub/tools/portlint/ +EXTRACT_SUFX= .shar + +MAINTAINER= frueauf@netbsd.org + +USE_PERL5= YES + +EXTRACT_CMD= ${CAT} +EXTRACT_BEFORE_ARGS= +EXTRACT_AFTER_ARGS= |sh + +NO_WRKSUBDIR= yes +NO_CONFIGURE= yes + +MAN1= portlint.1 + +do-build: + ${CAT} ${WRKSRC}/portlint.pl | \ + ${SED} s/@PREFIX@/${PREFIX:S/\//\\\\\//g}/g | \ + ${SED} s/@PORTSDIR@/${PORTSDIR:S/\//\\\\\//g}/g \ + > ${WRKSRC}/portlint + ${CAT} ${WRKSRC}/lintpkgsrc.sh | \ + ${SED} s/@PREFIX@/${PREFIX:S/\//\\\\\//g}/g | \ + ${SED} s/@PORTSDIR@/${PORTSDIR:S/\//\\\\\//g}/g \ + > ${WRKSRC}/lintpkgsrc + ${CAT} ${WRKSRC}/plist-clash.pl | \ + ${SED} s/@PREFIX@/${PREFIX:S/\//\\\\\//g}/g | \ + ${SED} s/@PORTSDIR@/${PORTSDIR:S/\//\\\\\//g}/g \ + > ${WRKSRC}/plist-clash + +do-install: + ${INSTALL_SCRIPT} ${WRKSRC}/portlint ${PREFIX}/bin/portlint + ${INSTALL_SCRIPT} ${WRKSRC}/lintpkgsrc ${PREFIX}/bin/lintpkgsrc + ${INSTALL_SCRIPT} ${WRKSRC}/plist-clash ${PREFIX}/bin/plist-clash + ${INSTALL_MAN} ${WRKSRC}/portlint.1 ${PREFIX}/man/man1 + +.include "../../mk/bsd.pkg.mk" diff --git a/devel/portlint/files/md5 b/devel/portlint/files/md5 new file mode 100644 index 00000000000..cc4897fe7fc --- /dev/null +++ b/devel/portlint/files/md5 @@ -0,0 +1 @@ +MD5 (portlint-1.64.shar) = ff367d03300131c00e510911684e3c4d 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) { diff --git a/devel/portlint/patches/patch-ab b/devel/portlint/patches/patch-ab new file mode 100644 index 00000000000..3abeb22f2a7 --- /dev/null +++ b/devel/portlint/patches/patch-ab @@ -0,0 +1,33 @@ +--- lintpkgsrc.sh-orig Sat Apr 25 13:37:27 1998 ++++ lintpkgsrc.sh Sat Apr 25 13:36:10 1998 +@@ -0,0 +1,30 @@ ++#!/bin/sh ++ ++PORTLINT=@PREFIX@/bin/portlint ++PORTLINTFLAGS="-a -b -c -v" ++ ++cd @PORTSDIR@ ++for i in * ++do ++ if [ -d $i/. -a $i != distfiles -a $i != packages ]; then ++ cd $i ++ for j in * ++ do ++ if [ -d $j/. -a $j != "CVS" -a $j != "pkg" ]; then ++ ${PORTLINT} ${PORTLINTFLAGS} $j \ ++ | grep -v '^OK' \ ++ | grep -v '^WARN: be sure to cleanup .*/work before committing the port' \ ++ | grep -v '^WARN: is it a new port' \ ++ >tmp$$ ++ if [ `cat tmp$$ | wc -l` -gt 1 ]; then ++ echo "" ++ echo "===> $i/$j" ++ echo ${PORTLINT} ${PORTLINTFLAGS} $j ++ cat tmp$$ ++ fi ++ rm -f tmp$$ ++ fi ++ done ++ cd .. ++ fi ++done diff --git a/devel/portlint/patches/patch-ac b/devel/portlint/patches/patch-ac new file mode 100644 index 00000000000..158210fe29f --- /dev/null +++ b/devel/portlint/patches/patch-ac @@ -0,0 +1,99 @@ +--- plist-clash.pl-orig Sat Apr 25 13:37:01 1998 ++++ plist-clash.pl Sat Apr 25 13:35:13 1998 +@@ -0,0 +1,97 @@ ++#!@PREFIX@/bin/perl ++# ++# Scan all ports and look for filenames used by more than one port. ++# ++ ++if(`uname -s` eq "FreeBSD"){ ++ $OS="FreeBSD"; ++ $PORTSDIR="/usr/ports"; ++}else{ ++ $OS="NetBSD"; ++ $PORTSDIR="@PORTSDIR@"; ++} ++ ++########################################################################### ++sub read_plist ++{ ++ local($pkg)=@_; ++ local($base); ++ ++ $prefix="\$LOCALBASE"; ++ ++ if(! -d $pkg){ ++ print "$pkg: no such dir\n"; ++ return; ++ } ++ ++ open(M,"$pkg/Makefile") || die "Can't read $pkg/Makefile: $!\n"; ++ while(<M>){ ++ $prefix="\$X11BASE" if /USE_X11/; ++ $prefix="\$X11BASE" if /USE_IMAKE/; ++ $prefix=$1 if /^PREFIX\??=\s*(\S+)/; ++ } ++ close(M); ++ ++ # printf "%-40s prefix=%s\n","$pkg:",$prefix; ++ ++ # NetBSD may have more than one PLIST file ++ opendir(D,"$pkg/pkg/.") || die "Can't readdir($pkg/pkg/.): $!\n"; ++ while($f=readdir(D)){ ++ if($f =~ /^PLIST/){ ++ next if $f=~/.orig$/; ++ ++ # printf("%-40s PLIST=$f\n","",$f); ++ ++ open(P,"$pkg/pkg/$f") or die "Can't read $pkg/pkg/$f: $!\n"; ++ while(<P>){ ++ next if /^@/; ++ chomp; ++ ++ # strip .gz off manpages - handled via MANZ ++ s/.gz$// if /^man/; ++ ++ ($p) = $pkg =~ m@$PORTSDIR/(.+)@; ++ if(0 and $F{"$prefix/$_"}){ ++ print "$prefix/$_ already used by ",$F{"$prefix/$_"},"\n"; ++ } ++ $F{"$prefix/$_"} .= " $p"; ++ } ++ close(P); ++ } ++ } ++ closedir(D); ++} ++ ++ ++########################################################################### ++# M A I N ++########################################################################### ++ ++if($#ARGV < 0){ ++ die "Usage: $0 portsdir1 ...\n"; ++} ++ ++# loop to parse all PLIST files ++foreach $pkg (@ARGV){ ++ print "===> $pkg\n"; ++ &read_plist($pkg); ++} ++ ++# Output diplicates ++foreach $file (sort keys %F){ ++ $pkgs=$F{$file}; ++ $pkgs=~s/^\s+//g; ++ ++ # clean up duplicates (e.g. via PLIST-*) ++ undef %pF; ++ foreach $p (split(/ /,$pkgs)){ ++ $pF{$p}=1; ++ } ++ @pkgs=sort keys %pF; ++ ++ $n=$#pkgs+1; ++ if($n>1){ ++ print "$n for $file: ",join(", ",@pkgs),"\n"; ++ } ++} diff --git a/devel/portlint/patches/patch-ad b/devel/portlint/patches/patch-ad new file mode 100644 index 00000000000..ad8b67a4a4f --- /dev/null +++ b/devel/portlint/patches/patch-ad @@ -0,0 +1,20 @@ +--- portlint.1-orig Sat Apr 25 14:38:24 1998 ++++ portlint.1 Sat Apr 25 14:55:43 1998 +@@ -106,10 +106,17 @@ + .El + .Sh FILES + .Bl -tag -width /usr/share/mk/bsd.port.mk -compact ++.It FreeBSD: + .It Pa /usr/share/mk/bsd.port.mk + master Makefile for ports + .It Pa /usr/ports/* + port collection ++.Pp ++.It NetBSD: ++.It Pa /usr/pkgsrc/mk/bsd.pkg.mk ++master Makefile for pkgsrc ++.It Pa /usr/pkgsrc/* ++pkgsrc collection + .Sh AUTHORS + Jun-ichiro Itoh <itojun@itojun.org> + and diff --git a/devel/portlint/pkg/COMMENT b/devel/portlint/pkg/COMMENT new file mode 100644 index 00000000000..94309919a61 --- /dev/null +++ b/devel/portlint/pkg/COMMENT @@ -0,0 +1 @@ +A verifier for NetBSD package directory. diff --git a/devel/portlint/pkg/DESCR b/devel/portlint/pkg/DESCR new file mode 100644 index 00000000000..8776f96e7ba --- /dev/null +++ b/devel/portlint/pkg/DESCR @@ -0,0 +1,10 @@ +Portlint tries to verify the content of a package directory. +The purpose of portlint can be separated into two parts: + (1) to let the submitters easily polish her/his own package + directory, and + (2) to decrease the labor of the committers. + +Portlint uses very simple regular-expression matching for verifying +files that make up a package directory. Note that it does NOT implement +complete parser for those files. Because of this the user may see some +extra warnings, especially when checking complex Makefiles. diff --git a/devel/portlint/pkg/PLIST b/devel/portlint/pkg/PLIST new file mode 100644 index 00000000000..11db5275674 --- /dev/null +++ b/devel/portlint/pkg/PLIST @@ -0,0 +1,5 @@ +@comment $NetBSD: PLIST,v 1.1 1998/04/25 13:23:36 frueauf Exp $ +bin/lintpkgsrc +bin/portlint +bin/plist-clash +man/man1/portlint.1 |