Hi Andrew,

Andrew Easton wrote on Fri, Jan 24, 2020 at 11:17:20PM +0100:

> I am running OpenBSD in a virtualbox because I am taking a deeper look
> into it.
> 
> I was looking for a list of ports packages

Depending what you really need, try

  $ doas pkg_add portslist
  $ less /usr/local/share/ports-INDEX

  $ doas pkg_add sqlports
  $ sqlite3 /usr/local/share/sqlports

  https://cvsweb.openbsd.org/ports/

> and read the man page pkg_info(1).
> 
> That man page it states, 
> "When browsing through uninstalled packages, running pkg_info -I *.tgz
> will report a summary line for each package [...]"
> 
> Note the capital eye 'I'.
> 
> It says so in the VMs man page as well as at
> https://man.openbsd.org/pkg_info
> (All Sections ; All Architectures ; OpenBSD-current)
> (Timestamp: approx. Fri 24 Jan 2020 10:05:00 PM UTC)
> 
> 
> When I run the command
> 
> # pkg_info -I *.tgz
> 
> I get the result
> 
> Invalid spec: *.tgz
> Invalid spec: *.tgz
> #
> <End of result>

Well, that's less a question about pkg_info(1) but more about
the sh(1).  In the https://man.openbsd.org/sh.1#Expansion section,
look for the paragraph beginning with

  After field splitting, the shell matches filename patterns.

So the above command only makes sense in a directory where you
do actually have some packages with file names that match the glob(7)
pattern "*.tgz", for example:

  schwarze@isnote $ cd /usr/ports/packages/amd64/all/
  schwarze@isnote $ ls groff*
  groff-1.22.3p9.tgz  groff-1.22.4p2.tgz  groff-git-1.22.4p3.tgz
  groff-1.22.4.tgz    groff-1.22.4p3.tgz
  schwarze@isnote $ pkg_info -D unsigned -I *.tgz | grep groff
  gpresent-2.3p0.tgz  make presentations with groff and PDF
  gpresent-2.5.tgz    make presentations with groff and PDF
  groff-1.22.3p9.tgz  GNU troff typesetter
  groff-1.22.4.tgz    GNU troff typesetter
  groff-1.22.4p2.tgz  GNU troff typesetter
  groff-1.22.4p3.tgz  GNU troff typesetter
  groff-git-1.22.4p3.tgz GNU troff typesetter
  ja-groff-1.10_0.99p2.tgz japanese groff

> If I run 
> # pkg_info -l *.tgz # NOTE the little ell instead of capital eye

Using -l in this way doesn't really make sense.
Look at

  $ man -O tag=l pkg_info                  # or
  https://man.openbsd.org/pkg_info.1#l

for what -l does.  You don't want to give "*.tgz" as an option
argument to -l.

> If I run
> # pkg_info -I
> 
> I get the result
> pkg_info: Missing package name(s)
> Usage: <...>

Yes.  It pays off to read manual pages and error messages closely,
at least on OpenBSD.

pkg_info(1) says:

  -I      Show the index entry for each package.

So with -I, you need to say for which package(s) you want to see
index entries.

> Searching for "openbsd pkg_info -I" with duckduckgo

Don't search the web for OpenBSD documentation that way.
Yes, for Linux, it's sometimes hard to get any help without
searching the web indiscriminately.  But for OpenBSD, everything
is supposed to be explained in the manual page of the program
you are trying to use, so look there.

Random stuff from the web is likely to just confuse you even
more.

> What other information can I provide to clarify where the problem lies?
> (It may be the man page, pkg_info, "layer 8" or a combination of these
> three factors.)

The information you provided was pretty good, i hope i could help.

Yours,
  Ingo

Reply via email to