From owner-freebsd-ports Mon Dec 4 22:10:15 2000 From owner-freebsd-ports@FreeBSD.ORG Mon Dec 4 22:09:53 2000 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mail.rdc1.kt.home.ne.jp (ha1.rdc1.kt.home.ne.jp [203.165.9.242]) by hub.freebsd.org (Postfix) with ESMTP id 5FE8037B400; Mon, 4 Dec 2000 22:09:52 -0800 (PST) Received: from daemon.local.idaemons.org ([203.165.161.10]) by mail.rdc1.kt.home.ne.jp (InterMail vM.4.01.02.00 201-229-116) with ESMTP id <20001205060948.CRSH20233.mail.rdc1.kt.home.ne.jp@daemon.local.idaemons.org>; Mon, 4 Dec 2000 22:09:48 -0800 Received: by daemon.local.idaemons.org (8.11.1/3.7W) id eB569jU49736; Tue, 5 Dec 2000 15:09:45 +0900 (JST) Date: Tue, 05 Dec 2000 15:09:45 +0900 Message-ID: <86sno3pffa.wl@archon.local.idaemons.org> From: "Akinori MUSHA" To: Will Andrews Cc: Maxim Sobolev , Michael Haro , FreeBSD-ports Subject: Re: portlint update In-Reply-To: <20001204224011.A570@puck.firepipe.net> References: <86u28kwghs.wl@archon.local.idaemons.org> <3A2B895D.D67E403A@FreeBSD.org> <86sno4w5g6.wl@archon.local.idaemons.org> <3A2BBF80.9CC69A1E@FreeBSD.org> <86r93ovxag.wl@archon.local.idaemons.org> <20001204224011.A570@puck.firepipe.net> User-Agent: Wanderlust/2.5.3 (Smooth) REMI/1.14.3 (Matsudai) FLIM/1.14.0 (Ninokuchi) APEL/10.2 MULE XEmacs/21.1 (patch 12) (Channel Islands) (i386--freebsd) Organization: Associated I. Daemons X-PGP-Public-Key: finger knu@FreeBSD.org X-PGP-Fingerprint: 081D 099C 1705 861D 4B70 B04A 920B EFC7 9FD9 E1EE MIME-Version: 1.0 (generated by REMI 1.14.3 - "Matsudai") Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org At Mon, 4 Dec 2000 22:40:11 -0500, Will Andrews wrote: > On Tue, Dec 05, 2000 at 03:47:19AM +0900, Akinori MUSHA wrote: > > - Conform to the new port layout. > > Why can't this depend on make -V PLIST etc..? Good point. It should. I've made it use COMMENT, DESCR, PLIST, PKGINSTALL, PKGDEINSTALL, PKGREQ, PKGMESSAGE, SCRIPTDIR and PATCHDIR where appropriate. :) > > - Add a condition "unless this is a master port" to the warnings that > > are specific to master ports, because currently we can't know if a > > port is a master port. > > That should be fixed. Possibly we could deal with it by adopting SLAVEDIRS officially, but the problem is that SLAVEDIRS, too, is inherited to the slaves and it must not be blindly undefined even if the port were a slave (i.e. MASTERDIR != ${.CURDIR}), because a slave port, too, can define its SLAVEDIRS and be a master port. :( By the way, I found another bug... @@ -415,9 +306,10 @@ open(IN, "< $file") || return 0; while () { - $linecnt++; - $longlines++ if ($maxchars{$file} < length(chomp($_))); $tmp .= $_; + chomp || &perror("WARN: $file should terminate in '\n'."); + $linecnt++; + $longlines++ if ($maxchars{$file} < length); } if ($linecnt > $maxlines{$file}) { &perror("WARN: $file $errmsg{$file}". As `length(chomp($_))' is always either 0 or 1, the maxchars check hasn't been working at all. ;( I think I've committed many ports which pkg-comment's are over 70 bytes in length... *shudder* > > .. and a new patch, as attached. > > Excellent work. I think a major version bump would be in order.. go for > 2.3. Thanks. I just hope it's always functional. I attach the latest patch as always. Michael, please apply this one. Additional log: - Use COMMENT, DESCR, PLIST, PKGINSTALL, PKGDEINSTALL, PKGREQ, PKGMESSAGE, SCRIPTDIR and PATCHDIR instead of hardcoded paths. - Fix maxchars checker that has been broken. ;) -- / /__ __ Akinori.org / MUSHA.org / ) ) ) ) / FreeBSD.org / Ruby-lang.org Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp "We're only at home when we're on the run, on the wing, on the fly" Index: Makefile =================================================================== RCS file: /home/ncvs/ports/devel/portlint/Makefile,v retrieving revision 1.41 diff -u -r1.41 Makefile --- Makefile 2000/11/10 07:43:54 1.41 +++ Makefile 2000/12/05 05:35:19 @@ -8,7 +8,7 @@ # PORTNAME= portlint -PORTVERSION= 2.2.3.1 +PORTVERSION= 2.3 CATEGORIES= devel MASTER_SITES= # none DISTFILES= # none Index: src/portlint.1 =================================================================== RCS file: /home/ncvs/ports/devel/portlint/src/portlint.1,v retrieving revision 1.5 diff -u -r1.5 portlint.1 --- src/portlint.1 2000/04/25 21:33:42 1.5 +++ src/portlint.1 2000/12/04 11:36:35 @@ -38,7 +38,7 @@ Perform additional checks for extra files, such as .Pa scripts/* and -.Pa pkg/* . +.Pa pkg-* . .It Fl b Warn the use of .Pa $(VARIABLE) . Index: src/portlint.pl =================================================================== RCS file: /home/ncvs/ports/devel/portlint/src/portlint.pl,v retrieving revision 1.23 diff -u -r1.23 portlint.pl --- src/portlint.pl 2000/11/10 07:20:43 1.23 +++ src/portlint.pl 2000/12/05 05:59:10 @@ -22,6 +22,7 @@ use vars qw/ $opt_a $opt_b $opt_c $opt_h $opt_t $opt_v $opt_M $opt_N $opt_B $opt_V /; use Getopt::Std; +use IPC::Open2; #use strict; my ($err, $warn); @@ -60,19 +61,25 @@ my $manchapters = '123456789ln'; my $localbase = '/usr/local'; -my @lang_cat = split(/\s+/, <); +close(MK); + +my $cmd = join(' -V MASTER_SITE_', "make $makeenv -f - all", @site_groups); + +my $i = 0; -# This list should be in sync with bsd.sites.mk -foreach my $i (split("\n", <) { + my $g = $site_groups[$i]; + for my $s (split()) { + $predefined{$s} = $g; + } + $i++; } +close(IN); + # # check for files. # my @checker = ($makevar{COMMENT}, $makevar{DESCR}, 'Makefile', $makevar{MD5_FILE}); -my %checker = ($makevar{COMMENT}, 'checkdescr', $makevar{DESCR}, 'checkdescr', - 'Makefile', 'checkmakefile', $makevar{MD5_FILE}, 'TRUE'); +my %checker = ( + $makevar{COMMENT} => 'checkdescr', + $makevar{DESCR} => 'checkdescr', + 'Makefile' => 'checkmakefile', + $makevar{MD5_FILE} => 'TRUE' + ); if ($extrafile) { - foreach my $i ((, )) { + my @files = ( + <$makevar{SCRIPTDIR}/*>, + @makevar{COMMENT,DESCR,PLIST,PKGINSTALL,PKGDEINSTALL,PKGREQ,PKGMESSAGE} + ); + + foreach my $i (@files) { next if (! -T $i); next if (defined $checker{$i}); - if ($i =~ /pkg\/PLIST$/ - || ($multiplist && $i =~ /pkg\/PLIST/)) { + if ($i =~ /\bpkg-plist$/ + || ($multiplist && $i =~ /\bpkg-plist/)) { unshift(@checker, $i); $checker{$i} = 'checkplist'; } else { @@ -360,7 +261,7 @@ } } } -foreach my $i () { +foreach my $i (<$makevar{PATCHDIR}/patch-*>) { next if (! -T $i); next if (defined $checker{$i}); push(@checker, $i); @@ -373,7 +274,7 @@ } else { my $proc = $checker{$i}; &$proc($i) || &perror("Cannot open the file $i\n"); - if ($i !~ /^patches\//) { + if ($i !~ /^files\/patch-/) { &checklastline($i) || &perror("Cannot open the file $i\n"); } @@ -402,7 +303,7 @@ exit $err; # -# pkg/COMMENT, pkg/DESCR +# pkg-comment, pkg-descr # sub checkdescr { my($file) = @_; @@ -415,9 +316,10 @@ open(IN, "< $file") || return 0; while () { - $linecnt++; - $longlines++ if ($maxchars{$file} < length(chomp($_))); $tmp .= $_; + chomp || &perror("WARN: $file should terminate in '\n'."); + $linecnt++; + $longlines++ if ($maxchars{$file} < length); } if ($linecnt > $maxlines{$file}) { &perror("WARN: $file $errmsg{$file}". @@ -434,7 +336,7 @@ "other local characters. $file should be ". "plain ascii file."); } - if ($file =~ m/DESCR/ && $tmp =~ m,http://,) { + if ($file =~ /\bpkg-descr/ && $tmp =~ m,http://,) { my $has_url = 0; my $has_www = 0; foreach my $line (grep($_ =~ "http://", split(/\n+/, $tmp))) { @@ -448,16 +350,16 @@ &perror("FATAL: $file: contains a URL but no WWW:"); } } - if ($file =~ m/COMMENT/) { - if (($tmp !~ /^["0-9A-Z]/) || ($tmp =~ m/\.$/)) { - &perror("WARN: pkg/COMMENT should begin with a capital, and end without a period"); + if ($file =~ /\bpkg-comment/) { + if (($tmp !~ /^["0-9A-Z]/) || ($tmp =~ m/\.$/)) { #" + &perror("WARN: pkg-comment should begin with a capital, and end without a period"); } } close(IN); } # -# pkg/PLIST +# pkg-plist # sub checkplist { my($file) = @_; @@ -501,22 +403,27 @@ $inforemoveseen = $.; push(@unexec_info, $1); } elsif ($_ =~ /^\@(exec|unexec)/) { - if ($ldconfigwithtrue - && /ldconfig/ - && !/\/usr\/bin\/true/) { - &perror("FATAL: $file $.: ldconfig ". - "must be used with ". - "\"||/usr/bin/true\"."); + if (/ldconfig/) { + if ($ldconfigwithtrue + && !/\/usr\/bin\/true/) { + &perror("FATAL: $file $.: ldconfig ". + "must be used with ". + "\"||/usr/bin/true\"."); + } + &perror("WARN: $file $.: possible ". + "direct use of ldconfig ". + "in PLIST found. use ". + "INSTALLS_SHLIB instead."); } } elsif ($_ =~ /^\@(comment)/) { $rcsidseen++ if (/\$$rcsidstr[:\$]/); } elsif ($_ =~ /^\@(owner|group)\s/) { - &perror("WARN: \@$1 should not be needed in PLIST"); + &perror("WARN: \@$1 should not be needed in pkg-plist"); } elsif ($_ =~ /^\@(dirrm|option)/) { ; # no check made } else { &perror("WARN: $file $.: ". - "unknown PLIST directive \"$_\""); + "unknown pkg-plist directive \"$_\""); } next; } @@ -531,6 +438,11 @@ "please use USE_LIBTOOL in Makefile if possible"); } + if ($_ =~ /\.so(\.\d+)?$/ && $makevar{INSTALLS_SHLIB} eq '') { + &perror("WARN: $file $.: installing shared libraries, ". + "please define INSTALLS_SHLIB as appropriate"); + } + if ($_ =~ /^info\/.*info(-[0-9]+)?$/) { $infoseen = $.; $infoafterinstall++ if ($infoinstallseen); @@ -591,10 +503,10 @@ foreach my $if (@infofile) { next if ($if =~ m/info-/); if ($exec_install !~ m/\%D\/\Q$if\E/) { - &perror("FATAL: you need an '\@exec install-info \%D/$if \%D/info/dir' line in your PLIST"); + &perror("FATAL: you need an '\@exec install-info \%D/$if \%D/info/dir' line in your pkg-plist"); } if ($unexec_install !~ m/\%D\/$if/) { - &perror("FATAL: you need an '\@unexec install-info --delete \%D/$if \%D/info/dir' line in your PLIST"); + &perror("FATAL: you need an '\@unexec install-info --delete \%D/$if \%D/info/dir' line in your pkg-plist"); } } @@ -700,6 +612,7 @@ my($i, $j, $k, $l); my @cat = (); my $has_lang_cat = 0; + my $lang_pref = ''; my $tmp; my $bogusdistfiles = 0; my @varnames = (); @@ -832,10 +745,10 @@ # my %cmdnames = (); print "OK: checking direct use of command names.\n" if ($verbose); - foreach my $i (split(/\s+/, <