HEADS UP - master/slave ports

Cyrille Lefevre clefevre-lists at 9online.fr
Thu Jun 17 14:50:21 GMT 2004


"Roman Neuhauser" <neuhauser at chello.cz> wrote:
>     Ugh, I see; I was confusing this with another feature... That would
>     make it
> 
>     _REALPORTSDIR!=     ${REALPATH} "${PORTSDIR}"
>     _REALMASTERDIR!=    ${REALPATH} "${MASTERDIR}"
>     MASTERPORT=     ${_REALMASTERDIR:S,^${_REALPORTSDIR}/,,}
> 
>     and I'm not sure that's any better than what you had originally.
> 
>     But, what will both versions output in databases/mysql40-client?

there is no need to fork any sub-processes :

# Try to determine if we are a slave port.  These variables are used by
# FreshPorts and portsmon, but not yet by the ports framework itself.
_MASTERDIR=   ${MASTERDIR:C,/([^/]+)/\.\.,,:C,/([^/]+)/\.\.,,}

.if ${_MASTERDIR} != ${.CURDIR}
IS_SLAVE_PORT?=        yes
# take your pick :
# _PORTSDIR=    ${_MASTERDIR:C|([^/]+/[^/]+)/?$||}
# MASTERPORT=   ${_MASTERDIR:C|${_PORTSDIR}||}
# or
MASTERPORT=     ${_MASTERDIR:H:T}/${_MASTERDIR:T}
.else
IS_SLAVE_PORT?=        no
MASTERPORT=
.endif

Cyrille Lefevre.
-- 
home: mailto:cyrille.lefevre at laposte.net



More information about the freebsd-ports mailing list