[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pkg_info and $PKG_PATH



On Sat, Aug 16, 2003 at 10:10:39AM -0700, Ben Goren wrote:
> On Sat, Aug 16, 2003 at 01:30:10AM -0600, Peter Valchev wrote:
> 
> > > I'm guessing that pkg_info should ignore $PKG_PATH.This is all
> > > on ...
> >
> > Why?   I don't  see why  it should  act different  than pkg_add,
> > etc., so  I think  the current  behaviour is  good, unless  I am
> > misunderstanding something here
> 
> First, pkg_info works on installed packages.

This is from pkg_info(1):

     The pkg_info command is used to dump out information for packages,
     which may be either packed up in files or already installed on the
     system with the pkg_create(1) command.

     The pkg-name may be the name of an installed package, the pathname
     to a package distribution file, or a URL to an ftp-available
     package.  pkg_info will try to complete pkg-name with a version
     number while looking through installed packages.

> Unless I'm mistraken, there's only one sane place  for the installed
> package information to live, and there's no sane way for that to be
> the same place you get the tarballs that you use to install the
> packages.

One can require pkg_info on a package that is not installed, as obvious
from the man page.

> Second, it never used to work like this. I don't have a 3.3-STABLE
> machine at  my fingertips, but  I'm pretty darn sure  its pkg_info
> ignores  $PKG_PATH. I  just   confirmed  that  3.2-STABLE  ignores
> $PKG_PATH.

I can't confirm that on my OpenBSD 3.2-STABLE machine.

$ uname -sr
OpenBSD 3.2
$ ls ~/tmp				# OpenBSD 3.3 package in ~/tmp
colorls-3.2.tgz
$ export PKG_PATH=$HOME/tmp:
$ echo $PKG_PATH
/home/zvezdan/tmp:
$ pkg_info -c colorls			# THIS IS INSTALLED
Information for colorls-3.0.1:

Comment:
ls that can use color to display file attributes


$ pkg_info -c colorls-3.2.tgz		# THIS IS FROM $PKG_PATH
Information for colorls-3.2.tgz:

Comment:
ls that can use color to display file attributes


So, pkg_info on OpenBSD 3.2 respects PKG_PATH quite fine.

Notice that PKG_PATH is a colon separated list.  Thus if you use
something like http://... or ftp://...  it will be TWO paths in
PKG_PATH.  One has to use full URL to get info.

$ pkg_info -c ftp://ftp.openbsd.org/pub/OpenBSD/3.3/packages/i386/co>
>>> ftp -o -
>>> ftp://ftp.openbsd.org/pub/OpenBSD/3.3/packages/i386/colorls-3.2.tgz
Unknown command.
Information for
ftp://ftp.openbsd.org/pub/OpenBSD/3.3/packages/i386/colorls-3.2.tgz:

Comment:
ls that can use color to display file attributes

Best regards,
-- 
Zvezdan Petkovic <zvezdan@cs.wm.edu>
http://www.cs.wm.edu/~zvezdan/