Strange behavior of 'exists' function. Need help with Makefile.

Yevgen Krapiva ykrapiva at gmail.com
Mon Dec 28 08:41:01 UTC 2009


Hi guys, 

I'm trying to create my own port. I'm stucked with the following
Makefile:

PORTNAME=      openjsip
PORTVERSION=   0.0.4
...
...
MY_FILE=       proxy.properties

do-check: 

	#FIRST TEST
.	if !exists(/usr/local/share/openjsip/conf/proxy.properties)
		@${ECHO_MSG} ">> /usr/local/share/openjsip/conf/proxy.properties
doesn't exist"
.	else
		@${ECHO_MSG} ">> /usr/local/share/openjsip/conf/proxy.properties
exists"
.	endif
	
	#SECOND TEST
	@${ECHO_MSG} ">> DATADIR=${DATADIR}"

.for f in ${MY_FILE}
.	if !exists(${DATADIR}/conf/${f})
		@${ECHO_MSG} ">> File ${DATADIR}/conf/${f} doesn't exist"
.	else
		@${ECHO_MSG} ">> File ${DATADIR}/conf/${f} exists"
.	endif
.endfor


I'm trying to make script to check the existence of proxy.properties
file.
The first test works well while to other one (with the use of 'for')
doesn't.
Can you help me, I don't understand why the second test fails.

OUTPUT:

ykrapiva at net/openjsip
>file /usr/local/share/openjsip/conf/proxy.properties
/usr/local/share/openjsip/conf/proxy.properties: ASCII English text,
with CRLF line terminators

ykrapiva at net/openjsip >make do-check
#FIRST TEST
>> /usr/local/share/openjsip/conf/proxy.properties exists
#SECOND TEST
>> DATADIR=/usr/local/share/openjsip
>> File /usr/local/share/openjsip/conf/proxy.properties doesn't exist



More information about the freebsd-ports mailing list