From owner-freebsd-ports@FreeBSD.ORG Thu Mar 20 21:44:44 2014 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86E81DD4 for ; Thu, 20 Mar 2014 21:44:44 +0000 (UTC) Received: from mail.grem.de (outcast.grem.de [213.239.217.27]) by mx1.freebsd.org (Postfix) with SMTP id CB9EE90D for ; Thu, 20 Mar 2014 21:44:43 +0000 (UTC) Received: (qmail 45792 invoked by uid 89); 20 Mar 2014 21:44:35 -0000 Received: from unknown (HELO bsd64.grem.de) (mg@grem.de@88.217.181.110) by mail.grem.de with ESMTPA; 20 Mar 2014 21:44:35 -0000 Date: Thu, 20 Mar 2014 22:44:36 +0100 From: Michael Gmelin To: Ken DEGUCHI Subject: Re: pkg_replace and detecting pkg(ng) Message-ID: <20140320224436.1c93b2e3@bsd64.grem.de> In-Reply-To: <20140319175236.6318b711cbd177569a30af84@sz.tokoha-u.ac.jp> References: <20140318190852.7b093b00@bsd64.grem.de> <20140319175236.6318b711cbd177569a30af84@sz.tokoha-u.ac.jp> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.18; amd64-portbld-freebsd9.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 21:44:44 -0000 On Wed, 19 Mar 2014 17:52:36 +0900 Ken DEGUCHI wrote: > Hello, > > I made a patch for your request. > > Please see, http://www.freebsd.org/cgi/query-pr.cgi?pr=187723 > > Thank you. > > > Hi, > > > > In the past I've been able to use pkg_replace on machine that didn't > > have the ports collection installed. > > > > With the current version of pkg_replace this doesn't seem to be > > possible anymore, since pkg(ng) detection breaks in those cases: > > > > : ${use_pkgng="`/usr/bin/make -f/usr/share/mk/bsd.port.mk -V > > WITH_PKGNG`"} > > if [ "x${use_pkgng}" = "xdevel" ]; then > > use_pkgng="yes" > > fi > > > > bsd.port.mk requires /usr/ports/Mk/... > > > > One of the main motivations to use pkg_replace for me is to not > > having a ports tree on the machines I use it on. > > > > I would suggest to replace this with a detection mechanism similar > > to what ports does: > > > > If sysctl -n kern.osreldate >= 1000017 > > use_pkgng=yes, unless WITHOUT_PKGNG is defined > > else if defined(WITH_PKGNG) (any value, not just ==yes) > > use_pkgng=yes > > else > > use_pkgng=no > > > > Determining WITH_PKGNG/WITHOUT_PKGNG should be done using make -V > > VAR (without specifying a Makefile, so /etc/make.conf is read). > > > > - Michael > > > > -- > > Michael Gmelin Hi Ken, Thanks for your swift response, I tested your patch (the part relevant to me) and it works as expected. Cool. - Michael -- Michael Gmelin