Re: pkg_info fails for non-installed packages when PKG_CACHE is set to a directory the current user can't write to

2017-11-02 Thread Craig Skinner
Hi Lari/Marc/all,

On Thu, 2 Nov 2017 00:21:08 +0200 Lari Rasku wrote:
> Oh, it's a ports tree mechanism? I only use packages, so I've been 
> using it for a fast reinstall/lookup cache in case I come to second 
> thoughts about some package:

Likewise, I have:

$ printenv | fgrep PKG_
PKG_CACHE=/var/cache/pkg
PKG_PATH=$PKG_CACHE:http://mirror.

/var/cache/pkg/ is group writable by wheel, so unpriv sysadmins can
do pkg_add -n to download & cache items, for root to install later.

I thought the cache was to reduce remote package server/network load.

Cheers,
-- 
Craig Skinner | http://linkd.in/yGqkv7



Re: pkg_info fails for non-installed packages when PKG_CACHE is set to a directory the current user can't write to

2017-11-01 Thread Lari Rasku

Marc Espie kirjoitti 11/01/17 klo 20:11:

On Wed, Nov 01, 2017 at 11:51:52AM +0100, Marc Espie wrote:

>> Somewhat low priority.
>
> Fairly easy to fix actually, so it's going to be in current, thx

Sweet.


Well, people usually don't define PKG_CACHE manually, but rely
on the ports tree to do it when needed.


Oh, it's a ports tree mechanism?  I only use packages, so I've been 
using it for a fast reinstall/lookup cache in case I come to second 
thoughts about some package:


$ cat /etc/profile
export PKG_CACHE=/var/cache/pkg
export PKG_PATH=$PKG_CACHE:installpath

Though this came back to bite me when I tried upgrading packages 
yesterday, as pkg_add -u naturally quit its search at the cache.  This 
one probably isn't a supported use case...




Re: pkg_info fails for non-installed packages when PKG_CACHE is set to a directory the current user can't write to

2017-11-01 Thread Marc Espie
On Wed, Nov 01, 2017 at 11:51:52AM +0100, Marc Espie wrote:
> On Mon, Oct 30, 2017 at 09:05:53PM +0200, Lari Rasku wrote:
> > Oct 27 snapshot, amd64.
> > 
> > When PKG_CACHE is set:
> > 
> > $ cat /etc/profile
> > export PKG_CACHE=/var/cache/pkg
> > 
> > To a directory the current user lacks write access to:
> > 
> > $ touch /var/cache/pkg/somefile
> > touch: /var/cache/pkg/somefile: Permission denied
> > 
> > Trying to call pkg_info on an uninstalled package fails:
> > 
> > $ pkg_info -e lumina-1.3.0pl1p2; echo $?
> > 1
> > $ pkg_info lumina-1.3.0pl1p2
> > Fatal error: bad PKG_CACHE directory /var/cache/pkg
> >  at /usr/libdata/perl5/OpenBSD/PackageRepository.pm line 669.
> > 
> > This is surprising, because I didn't expect pkg_info to write anything but
> > temporary files; PKG_CACHE is not documented on pkg_info(1).  The program
> > doesn't apparently even intend to cache anything, as when I temporarily set
> > PKG_CACHE to something writable:
> 
> Fun one. Well, people usually don't define PKG_CACHE manually, but rely
> on the ports tree to do it when needed.
> 
> Tweaking the full chain to only handle it with pkg_add would be feasible.
> 
> Somewhat low priority.

Fairly easy to fix actually, so it's going to be in current, thx



Re: pkg_info fails for non-installed packages when PKG_CACHE is set to a directory the current user can't write to

2017-11-01 Thread Marc Espie
On Mon, Oct 30, 2017 at 09:05:53PM +0200, Lari Rasku wrote:
> Oct 27 snapshot, amd64.
> 
> When PKG_CACHE is set:
> 
>   $ cat /etc/profile
>   export PKG_CACHE=/var/cache/pkg
> 
> To a directory the current user lacks write access to:
> 
>   $ touch /var/cache/pkg/somefile
>   touch: /var/cache/pkg/somefile: Permission denied
> 
> Trying to call pkg_info on an uninstalled package fails:
> 
>   $ pkg_info -e lumina-1.3.0pl1p2; echo $?
>   1
>   $ pkg_info lumina-1.3.0pl1p2
>   Fatal error: bad PKG_CACHE directory /var/cache/pkg
>at /usr/libdata/perl5/OpenBSD/PackageRepository.pm line 669.
> 
> This is surprising, because I didn't expect pkg_info to write anything but
> temporary files; PKG_CACHE is not documented on pkg_info(1).  The program
> doesn't apparently even intend to cache anything, as when I temporarily set
> PKG_CACHE to something writable:

Fun one. Well, people usually don't define PKG_CACHE manually, but rely
on the ports tree to do it when needed.

Tweaking the full chain to only handle it with pkg_add would be feasible.

Somewhat low priority.