From owner-freebsd-ports@FreeBSD.ORG Wed Feb 25 19:17:52 2004 Return-Path: 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 5382C16A4CE for ; Wed, 25 Feb 2004 19:17:52 -0800 (PST) Received: from ybbsmtp03.mail.yahoo.co.jp (ybbsmtp03.mail.yahoo.co.jp [210.81.151.171]) by mx1.FreeBSD.org (Postfix) with SMTP id 7413343D1D for ; Wed, 25 Feb 2004 19:17:51 -0800 (PST) (envelope-from ayakokiko@ybb.ne.jp) Received: from unknown (HELO gorgon.near.this) (219.11.234.11 with poptime) by ybbsmtp03.mail.yahoo.co.jp with SMTP; 26 Feb 2004 03:17:50 -0000 X-Apparently-From: Received: from ghost.near.this (ghost.near.this [10.0.3.9]) by gorgon.near.this (Postfix) with ESMTP id 3F1887F81; Thu, 26 Feb 2004 12:17:44 +0900 (JST) Received: by ghost.near.this (Postfix, from userid 100) id 0927C1932C; Thu, 26 Feb 2004 12:17:42 +0900 (JST) Date: Thu, 26 Feb 2004 12:17:41 +0900 From: horio shoichi To: Mark Linimon In-Reply-To: References: X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-portbld-freebsd4.8) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20040226.031742.115e504b7318efa4.10.0.3.9@bugsgrief.net> cc: ports@FreeBSD.org Subject: Re: how to determine whether a port is a slave port? X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Feb 2004 03:17:52 -0000 On Tue, 24 Feb 2004 00:25:47 -0600 (CST) Mark Linimon wrote: > One of the things that I would like to have available for the > database in my ports monitoring code is an indication of whether > or not a port is a slave port. The Porter's Handbook recommends > that the MASTERDIR makevar be used to establish that, but does > not make it clear whether its use is mandatory or not. However, > there are over 300 ports that do not seem to use this convention. > Most seem to use the "${.CURDIR}/.." convention, although a few > seem to use PORTSDIR directly. > > So, without wanting to start a bikeshed, are these just remnants > of a time before MASTERDIR was introduced? Is there a consensus > on how slave ports ought to be handled? > > mcl > > _______________________________________________ > freebsd-ports@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-ports > To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org" > A clip from my collection. Further clip your necessary part from here. # switch to masterdir # return 0 iff there is (distinct) masterdir and have switched to it switchtomasterdir() { local - [ -r Makefile ] || return 1 set -- $(make -V MASTERDIR -V .CURDIR) [ $# -ne 2 ] && return 1 set -- $(csh -fc "cd $1 ; echo \$cwd") $(csh -fc "cd $2 ; echo \$cwd") [ $1 != $2 ] && { echo "-- MASTERDIR = $1 --" cd $1 } } HTH, horio shocihi