Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Jan 2011 00:25:50 +0300
From:      Ruslan Mahmatkhanov <cvs-src@yandex.ru>
To:        Matthew Seaman <m.seaman@infracaninophile.co.uk>
Cc:        ports@freebsd.org, Jason Helfman <jhelfman@e-e.com>
Subject:   Re: New port needs review: net/erlyvideo
Message-ID:  <4D3DEE5E.4090401@yandex.ru>
In-Reply-To: <4D34B94D.305@infracaninophile.co.uk>
References:  <11111295127072@web122.yandex.ru>	<4D3329FE.7020901@yandex.ru>	<20110116204416.GA1654@eggman.experts-exchange.com>	<4D3361B3.40201@yandex.ru>	<20110116214557.GA2179@eggman.experts-exchange.com>	<4D34A312.8060808@yandex.ru>	<20110117202625.GA55917@eggman.experts-exchange.com> <4D34B94D.305@infracaninophile.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
18.01.2011 00:49, Matthew Seaman пишет:
> On 17/01/2011 20:26, Jason Helfman wrote:
>>> .for dir in /var/lib/${PORTNAME}/movies /var/lib/${PORTNAME}/plugins
>>> \         /var/log/${PORTNAME} ${ETCDIR} ${ERLYDIR} ${WWWDIR}
>>>      ${MKDIR} ${dir}
>>> .endfor
>>> """
>
> This snippet needs to be associated with some sort of make target or it
> will never get run.  You can do something like this:
>
> DIRS= /var/lib/${PORTNAME}/movies     \
>        /var/lib/${PORTNAME}/plugins    \
>        /var/log/${PORTNAME}            \
>        ${ETCDIR}  ${ERLYDIR} ${WWWDIR}
>
> .for dir  in $DIRS
>
> dirs :: ${dir}
> 	${MKDIR} ${.TARGET}
>
> .endfor

I used
${MKDIR} ${ETCDIR} ${ERLYDIR} ${WWWDIR}

and

.for dir in /var/lib/${PORTNAME}/movies /var/lib/${PORTNAME}/plugins \
	/var/log/${PORTNAME}
	${MKDIR} ${dir}
.endfor

And it works fine for me both with port and package.

>
>
> Or you could have just one target and put a shell loop as the action:
>
> DIRS= ...
>
> dirs :
> 	for d in ${DIRS} ; do \
> 	    ${MKDIR} $$d ;    \
>          done
>
> Note the backslashes so that make(1) executes all of that as one
> command, and the required use of ';' to mark the end of the different
> shell statements.
>
>> I believe you need to do this:
>>
>>      ${MKDIR} $${dir}
>
> No -- that's not the case here.  You need to do this if you have a shell
> for-loop as part of the action of a target (the second example above),
> as $$ causes make to pass a literal $ through to the underlying shell,
> rather than expanding it as a make(1) variable.
>
> 	Cheers,
>
> 	Matthew
>


-- 
Regards,
Ruslan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D3DEE5E.4090401>