Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Dec 2009 10:13:42 +0200
From:      Yevgen Krapiva <ykrapiva@gmail.com>
To:        freebsd-ports@freebsd.org
Subject:   Strange behavior of 'exists' function. Need help with Makefile.
Message-ID:  <1261988022.9116.14.camel@kv-po-ykrapivanb.umc.com.ua>

next in thread | raw e-mail | index | archive | help
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@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@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




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