Re: devel/glib20 packages

From: Pat Maddox <pat_at_patmaddox.com>
Date: Tue, 29 Nov 2022 01:57:25 UTC
On 28 Nov 2022, at 15:59, Graham Perrin wrote:

> I'm confused.
>
> If pkg search -r FreeBSD devel/glib20 *does* find the package, then 
> why does pkg search -r FreeBSD glib20 *not* find the package?
>
> Also, why the emptiness at 
> <https://www.freshports.org/devel/glib20/#packages>?
>
> ----
>
> % pkg search glib20
> % pkg search -r FreeBSD glib20
> % pkg search -r FreeBSD devel/glib20
> devel/glib20                   Some useful routines 
> of C programming (current stable version)
> % pkg info -x devel/glib20
> glib-2.74.1,2
> %


Not sure about the emptiness.

The answer to your first question is found in 
[pkg-search(8)](https://www.freebsd.org/cgi/man.cgi?pkg-search):

     -S	search,	--search search
         Specify the field to search the repository catalogue on.  If
         unspecified, searches on pkg-name unless the search term con-
         tains a / character, when it searches on port origin.	Output
         will be sorted	in order of the	search field.  See the "Search
         and Label Options" sections for more details.

Looking at the [glib20 
Makefile](https://cgit.freebsd.org/ports/tree/devel/glib20/Makefile), 
you can see that the port name is `glib`.

So, `pkg search glib20` searches for a _package_ named `glib20`, which 
doesn’t exist. `pkg search devel/glib20` searches for an _origin_ 
named `devel/glib20`, which does exist.

Pat