Re: pkg_replace and detecting pkg(ng)

2014-03-20 Thread Michael Gmelin
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 >= 117
> >  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
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: pkg_replace and detecting pkg(ng)

2014-03-19 Thread Ken DEGUCHI
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 >= 117
>  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
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


pkg_replace and detecting pkg(ng)

2014-03-18 Thread Michael Gmelin
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 >= 117
 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
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"