Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Mar 2014 22:44:36 +0100
From:      Michael Gmelin <freebsd@grem.de>
To:        Ken DEGUCHI <kdeguchi@sz.tokoha-u.ac.jp>
Cc:        ports@freebsd.org
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>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 19 Mar 2014 17:52:36 +0900
Ken DEGUCHI <kdeguchi@sz.tokoha-u.ac.jp> 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



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