From owner-freebsd-ports@FreeBSD.ORG Tue Jan 24 21:15:05 2006 Return-Path: X-Original-To: ports@freebsd.org Delivered-To: freebsd-ports@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 293CA16A41F; Tue, 24 Jan 2006 21:15:05 +0000 (GMT) (envelope-from laszlof@vonostingroup.com) Received: from ritamari.vonostingroup.com (ritamari.vonostingroup.com [216.144.193.230]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5D6AC43D58; Tue, 24 Jan 2006 21:14:54 +0000 (GMT) (envelope-from laszlof@vonostingroup.com) Received: from adsl-68-72-248-38.dsl.sfldmi.ameritech.net ([68.72.248.38] helo=[192.168.1.33]) by ritamari.vonostingroup.com with esmtpa (Exim 4.60 (FreeBSD)) (envelope-from ) id 1F1VV9-000FCe-Fj; Tue, 24 Jan 2006 16:14:55 -0500 Message-ID: <43D698C8.60609@vonostingroup.com> Date: Tue, 24 Jan 2006 16:14:48 -0500 From: Frank Laszlo User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: Paul Schmehl References: <6E2E84047A522AA3CF4F3F8D@utd59514.utdallas.edu> <43D65689.8050207@vonostingroup.com> <0CAD779515C871FE2C1AC21E@utd59514.utdallas.edu> <43D661F0.5090802@FreeBSD.org> <9B2BA4ED22481885FB14746D@utd59514.utdallas.edu> <43D68AC7.3020402@FreeBSD.org> <43D68D0B.4060702@vonostingroup.com> <20060124204740.GB21232@odin.ac.hmc.edu> <43D694C7.308@vonostingroup.com> <1889A83583045D2F7963B083@utd59514.utdallas.edu> In-Reply-To: <1889A83583045D2F7963B083@utd59514.utdallas.edu> X-Enigmail-Version: 0.93.2.0 OpenPGP: url=http://www.franksworld.org/~laszlof/keys/0x0B3FCA4B.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ritamari.vonostingroup.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [26 6] X-AntiAbuse: Sender Address Domain - vonostingroup.com X-Source: X-Source-Args: X-Source-Dir: Cc: Brooks Davis , ports@freebsd.org, Joe Marcus Clarke Subject: Re: Something wrong with portlint? X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2006 21:15:05 -0000 __________________________________________________ Frank Laszlo System Administrator The VonOstin Group Email: laszlof@tvog.net WWW: http://www.vonostingroup.com Mobile: 248-863-7584 Paul Schmehl wrote: > --On Tuesday, January 24, 2006 15:57:43 -0500 Frank Laszlo > wrote: > >> Paul Schmehl wrote: >>> --On Tuesday, January 24, 2006 12:47:40 -0800 Brooks Davis >>> wrote: >>> >>>> On Tue, Jan 24, 2006 at 02:38:56PM -0600, Paul Schmehl wrote: >>>>> --On Tuesday, January 24, 2006 15:24:43 -0500 Frank Laszlo >>>>> wrote: >>>>> > >>>>> > Put a newline after the "commented" section on the top, all is >>>>> fine. >>>>> > Like so: >>>>> > >>>>> ># New ports collection makefile for: barnyard >>>>> ># Date created: 1 Feb 2005 >>>>> ># Whom: pauls >>>>> ># >>>>> ># $FreeBSD: ports/security/barnyard/Makefile,v 1.5 2005/11/15 >>>>> 06:50:54 >>>>> > ade Exp $ >>>>> ># >>>>> > >>>>> > PORTNAME= barnyard >>>>> > >>>>> > >>>>> > Cheers, >>>>> > Frank >>>>> >>>>> Sheesh. Wouldn't it be nice if the Handbook actually stipulated >>>>> that? >>>> >>>> Or better yet if the worthless comment section died except for the >>>> $FreeBSD$ bit. :-P >>>> >>> But you'd still have the required newline between that and the text of >>> the Makefile, right? >>> >>> >> It shouldn't really be required, its mostly just cosmetic. >> > But if you leave it out, it drives portlint nuts. > Portlint splits the Makefile up into sections, and I believe the code to do this is where the 'requirement' for the newline exists. Here is the applicable code: <--- Begin Code ---> # # break the makefile into sections. # $tmp = $rawwhole; # keep comment, blank line, comment in the same section $tmp =~ s/(#.*\n)\n+(#.*)/$1$2/g; @sections = split(/\n\n+/, $tmp); for ($i = 0; $i <= $#sections; $i++) { if ($sections[$i] !~ /\n$/) { $sections[$i] .= "\n"; } } $idx = 0; # # section 1: comment lines. # print "OK: checking comment section of $file.\n" if ($verbose); my @linestocheck = split("\n", < $tmp = $sections[$idx++]; $tmp = "\n" . $tmp; # to make the begin-of-line check easier if ($tmp =~ /\n[^#]/) { &perror("FATAL: $file: non-comment line in comment section."); } <--- End Code---> As you can see it splits the sections based on 2 consecutive \n's. (equivalent to the end of one line, and a blank line) Then when it gets to the actual checking portion, it checks the 'comment' section, which now contains everything in the "PORTNAME" section because there was no newline to split it. This part does not start with a '#' so it errors out, and complains about missing the PORTNAME, CATEGORIES, etc. because they were in the comment section, Seems like there should be a matter way to do this. Regards, Frank