pkg_replace and detecting pkg(ng)

Michael Gmelin freebsd at
Tue Mar 18 18:09:01 UTC 2014


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/ -V
if [ "x${use_pkgng}" = "xdevel" ]; then
fi 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)

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

More information about the freebsd-ports mailing list