HEADS UP - master/slave ports

Dan Langille dan at langille.org
Thu Jun 17 18:03:03 GMT 2004


On 17 Jun 2004 at 16:50, Cyrille Lefevre wrote:

> "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}||}

real    15m24.018s
user    10m39.785s
sys     4m35.054s

> # or
> MASTERPORT=     ${_MASTERDIR:H:T}/${_MASTERDIR:T}

real    15m23.343s
user    10m39.088s
sys     4m34.888s

> .else
> IS_SLAVE_PORT?=        no
> MASTERPORT=
> .endif

These appear to be slightly faster than the previous stats I posted.  
Everything is pratically identical in user time.  sys is where the 
savings are being made. 
-- 
Dan Langille : http://www.langille.org/
BSDCan - http://www.bsdcan.org/



More information about the freebsd-ports mailing list