New port needs review: net/erlyvideo

Ruslan Mahmatkhanov cvs-src at yandex.ru
Mon Jan 24 21:26:59 UTC 2011


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


More information about the freebsd-ports mailing list