Date: Sat, 07 Jan 2006 02:27:47 -0800 From: Doug Barton <dougb@FreeBSD.org> To: KOMATSU Shinichiro <koma2@lovepeers.org> Cc: Jeremy Messenger <mezz7@cox.net>, Sam Lawrance <boris@brooknet.com.au>, freebsd ports <freebsd-ports@freebsd.org> Subject: Re: New /bin/sh based script to manage ports Message-ID: <43BF97A3.1090205@FreeBSD.org> In-Reply-To: <43BF8EF1.3000005@lovepeers.org> References: <43BCF31F.8050900@FreeBSD.org> <op.s2w24xlg9aq2h7@mezz.mezzweb.com> <43BF7F8D.6080809@FreeBSD.org> <20060107092614.GH79296@pcwin002.win.tue.nl> <43BF8EF1.3000005@lovepeers.org>
next in thread | previous in thread | raw e-mail | index | archive | help
KOMATSU Shinichiro wrote: > PORTSDIR is set in bsd.port.mk, which is not included > if you do not explicitly include it by ".include <bsd.port.mk>". > Don't you set it in /etc/make.conf or environment variable? > > Recently I thought the same problem, and > the best solution I came up with till now is > running the following command: > > % echo '.include <bsd.port.mk>' | make -f - -V PORTSDIR Actually Sam Lawrance was kind enough to point out that that you can simply do 'make -V VAR' even without a Makefile. I had tried this approach, but was discouraged when I didn't get a value back. After Sam's encouragement though, it dawned on me that a value would appear using this method if there was one set in /etc/make.conf. I tested this method, and incorporated it in a new version of portmaster which I just uploaded to my web site. KOMATSU-san, you might want to be aware that on RELENG_4 doing 'make -V VAR' without a Makefile, will print an error message. I handled it this way: portsdir=`make -V PORTSDIR 2>/dev/null` pkg_dbdir=`make -V PKG_DBDIR 2>/dev/null` ... : ${portsdir:=/usr/ports} : ${pkg_dbdir:=/var/db/pkg} hth, Doug PS, thanks Sam! -- This .signature sanitized for your protection
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43BF97A3.1090205>