From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Mar 18 05:40:23 2004 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4B28B16A4CE for ; Thu, 18 Mar 2004 05:40:23 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3E5A543D2F for ; Thu, 18 Mar 2004 05:40:23 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i2IDeNbv090123 for ; Thu, 18 Mar 2004 05:40:23 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i2IDeN3W090122; Thu, 18 Mar 2004 05:40:23 -0800 (PST) (envelope-from gnats) Resent-Date: Thu, 18 Mar 2004 05:40:23 -0800 (PST) Resent-Message-Id: <200403181340.i2IDeN3W090122@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Oliver Eikemeier Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D452816A4CE; Thu, 18 Mar 2004 05:31:01 -0800 (PST) Received: from postman.arcor.de (postman2.arcor-online.net [151.189.0.152]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3F42743D41; Thu, 18 Mar 2004 05:31:01 -0800 (PST) (envelope-from eikemeier@fillmore-labs.com) Received: from fillmore.dyndns.org (port-212-202-51-138.reverse.qsc.de [212.202.51.138]) (authenticated bits=0)i2IDUwko003602 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 18 Mar 2004 14:31:00 +0100 (MET) Received: from [172.16.0.2] (helo=fillmore-labs.com) by fillmore.dyndns.org with esmtp (Exim 4.30; FreeBSD) id 1B3xbm-000JhF-MD; Thu, 18 Mar 2004 14:30:50 +0100 Message-Id: <4059A48A.4020905@fillmore-labs.com> Date: Thu, 18 Mar 2004 14:30:50 +0100 From: Oliver Eikemeier To: FreeBSD-gnats-submit@FreeBSD.org cc: Joe Marcus Clarke Subject: ports/64420: [PATCH] devel/portlint: check for proper master-slave Makefile handling X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Mar 2004 13:40:23 -0000 >Number: 64420 >Category: ports >Synopsis: [PATCH] devel/portlint: check for proper master-slave Makefile handling >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Mar 18 05:40:22 PST 2004 >Closed-Date: >Last-Modified: >Originator: Oliver Eikemeier >Release: FreeBSD 4.9-STABLE i386 >Organization: Fillmore Labs - http://www.fillmore-labs.com >Environment: System: FreeBSD nuuk.fillmore-labs.com 4.9-STABLE >Description: This patch updates portlint to check for the rules formulated in PR 64393, refer to this PR for some rationale. 1.) A port is a slave port if and only if MASTERDIR != .CURDIR 2.) Slave ports should define MASTERDIR using one of the following lines: MASTERDIR= ${.CURDIR}/../..// MASTERDIR= ${.CURDIR}/../ 3.) Non-slave ports shouldn't define MASTERDIR at all 4.) The last line of a slave port's Makefile has to be .include "${MASTERDIR}/Makefile" 5.) The last line of a non-slave ports Makefile must be one of: .include .include 6.) slave ports may not include bsd.port(.pre).mk >How-To-Repeat: These are detected as follows: 1.) is flagged FATAL, check with /usr/local/share/examples/portlint/portlintgrep 'CURDIR != MASTERDIR' 2.) and 3.) are flagged WARN, check with /usr/local/share/examples/portlint/portlintgrep 'define MASTERDIR' 4.) and 5.) are flagged FATAL, check with /usr/local/share/examples/portlint/portlintgrep 'last line of' 6.) is flagged FATAL, part of the is seen as violating 1.), check with /usr/local/share/examples/portlint/portlintgrep 'may not include' >Fix: bump PORTVERSION and apply the following patch: --- devel/portlint/src/portlint.pl Wed Mar 10 11:43:45 2004 +++ devel/portlint/src/portlint.pl Thu Mar 18 14:11:25 2004 @@ -1046,16 +1046,6 @@ } # - # whole file: anything after bsd.port(.post).mk - # - print "OK: checking for anything after bsd.port(.post).mk.\n" - if ($verbose); - if ($whole =~ /^\.include\s+\s*[^\s]/m) { - &perror("FATAL: $file: do not include anything after ". - "bsd.port(.post).mk."); - } - - # # whole file: USE_* as a user-settable option # print "OK: checking for USE_* as a user-settable option.\n" if ($verbose); @@ -1274,13 +1264,35 @@ $slaveport = 1; print "OK: slave port detected, checking for inclusion of $masterdir/Makefile.\n" if ($verbose); - if ($whole !~ /\n\.include\s+[<"]\$\{MASTERDIR\}\/Makefile[">]\s*$/) { - &perror('FATAL: $file: the last line of a slave port\'s Makefile has to be'. + if ($whole =~ /^\.\s*include\s*[<"]bsd\.port(?:\.post)?\.mk[">]/m) { + &perror("FATAL: $file: supposedly non-slave port with". + " .CURDIR != MASTERDIR"); + } elsif ($whole =~ /^\.\s*include\s*[<"]bsd\.port\.pre\.mk[">]/m) { + &perror("FATAL: $file: slave ports may not include". + " bsd.port.pre.mk"); + } + if ($whole !~ /\n\.include\s+"\$\{MASTERDIR\}\/Makefile"\s*$/s) { + &perror("FATAL: $file: the last line of a slave port's Makefile has to be". ' .include "${MASTERDIR}/Makefile"'); } print "OK: checking master port in $masterdir.\n" if ($verbose); if (! -e "$masterdir/Makefile") { &perror("WARN: unable to locate master port in $masterdir"); + } + if ($whole !~ /^MASTERDIR=\s*\$\{\.CURDIR\}(?:\/\.\.){1,2}(?:\/[\w\@.+-]+){1,2}\s*$/m) { + &perror('WARN: $file: slave ports must define MASTERDIR='. + '${.CURDIR}/..(/../)/'); + } + } else { + #$slaveport = 0; + print "OK: non-slave port detected, checking for anything after bsd.port(.post).mk.\n" + if ($verbose); + if ($whole !~ /\n\.include\s+\s*$/s) { + &perror("FATAL: $file: the last line of Makefile has to be". + ' .include '); + } + if ($whole =~ /^MASTERDIR\s*[+?:!]?\s*=/m) { + &perror("WARN: $file: non-slave ports may not define MASTERDIR"); } } >Release-Note: >Audit-Trail: >Unformatted: