From owner-freebsd-ports@FreeBSD.ORG Sat Jan 7 10:27:50 2006 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E6D0116A41F for ; Sat, 7 Jan 2006 10:27:50 +0000 (GMT) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mail2.fluidhosting.com [204.14.90.12]) by mx1.FreeBSD.org (Postfix) with SMTP id 27BDD43D55 for ; Sat, 7 Jan 2006 10:27:50 +0000 (GMT) (envelope-from dougb@FreeBSD.org) Received: (qmail 5549 invoked by uid 399); 7 Jan 2006 10:27:49 -0000 Received: from localhost (HELO ?192.168.1.100?) (dougb@dougbarton.us@127.0.0.1) by localhost with SMTP; 7 Jan 2006 10:27:49 -0000 Message-ID: <43BF97A3.1090205@FreeBSD.org> Date: Sat, 07 Jan 2006 02:27:47 -0800 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 1.5 (X11/20051226) MIME-Version: 1.0 To: KOMATSU Shinichiro References: <43BCF31F.8050900@FreeBSD.org> <43BF7F8D.6080809@FreeBSD.org> <20060107092614.GH79296@pcwin002.win.tue.nl> <43BF8EF1.3000005@lovepeers.org> In-Reply-To: <43BF8EF1.3000005@lovepeers.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Jeremy Messenger , Sam Lawrance , freebsd ports Subject: Re: New /bin/sh based script to manage ports X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2006 10:27:51 -0000 KOMATSU Shinichiro wrote: > PORTSDIR is set in bsd.port.mk, which is not included > if you do not explicitly include it by ".include ". > 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 ' | 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