Re: wip/mk/git-package.mk cleanups

Richard Hansen <[email protected]> Sun, 04 May 2014 03:00:48 -0400
Newsgroups gmane.os.netbsd.devel.packages,gmane.os.netbsd.devel.pkgsrc.wip.general
Message-ID <[email protected]>
On 2014-05-04 02:47, Thomas Klausner wrote:
> Hi Richard!
> 
> Thanks for the patches!
> 
> Just one question:
> 
> On Thu, May 01, 2014 at 03:34:56PM -0400, Richard Hansen wrote:
>> +post-extract: do-git-post-extract
>> +.PHONY: do-git-post-extract
>> +do-git-post-extract:
>> +.if ${GIT_REPOSITORIES:[\#]} > 0
>> +	${RUN}								\
>> +	if [ ! -e ${WRKSRC:Q} ] && [ ! -h ${WRKSRC:Q} ]; then		\
>> +		${LN} -s ${GIT_MODULE.${GIT_REPOSITORIES:[1]}:Q}	\
>> +			${WRKSRC:Q};					\
>> +	fi;
>> +.endif
>> +
>>  .endif
> 
> NetBSD's test documents -e as:
>      -e file       True if file exists (regardless of type).
> so I wonder why the -h test is needed.

If a symlink exists but points to something that doesn't exist then test
-e will still return false.  (This behavior conforms to POSIX.)

-Richard