how to determine whether a port is a slave port?

horio shoichi bugsgrief at bugsgrief.net
Wed Feb 25 19:17:52 PST 2004


On Tue, 24 Feb 2004 00:25:47 -0600 (CST)
Mark Linimon <linimon at lonesome.com> 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 at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-ports
> To unsubscribe, send any mail to "freebsd-ports-unsubscribe at 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



More information about the freebsd-ports mailing list