From owner-freebsd-ports@FreeBSD.ORG Tue Mar 18 18:09:01 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 87310177 for ; Tue, 18 Mar 2014 18:09:01 +0000 (UTC) Received: from mail.grem.de (outcast.grem.de [213.239.217.27]) by mx1.freebsd.org (Postfix) with SMTP id CE4FA832 for ; Tue, 18 Mar 2014 18:09:00 +0000 (UTC) Received: (qmail 6120 invoked by uid 89); 18 Mar 2014 18:08:52 -0000 Received: from unknown (HELO bsd64.grem.de) (mg@grem.de@194.97.158.66) by mail.grem.de with ESMTPA; 18 Mar 2014 18:08:52 -0000 Date: Tue, 18 Mar 2014 19:08:52 +0100 From: Michael Gmelin To: kdeguchi@sz.tokoha-u.ac.jp, Subject: pkg_replace and detecting pkg(ng) Message-ID: <20140318190852.7b093b00@bsd64.grem.de> 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 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: Tue, 18 Mar 2014 18:09:01 -0000 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