Inline… > Am 14.04.2023 um 12:50 schrieb Stuart Henderson <stu.li...@spacehopper.org>: > > On 2023-04-14, Mike Fischer <fischer+o...@lavielle.com> wrote: >> Usually when looking for a port to install I use `pkg_info -Q name` to >> search for the the port. >> >> Strangely this does not completely work for PHP on OpenBSD 7.3: >> >> `pkg_info -Q php` does not list PHP 7.4.33 and related ports which are >> clearly available. >> >> It seems that -Q only finds ports in packages-stable/, not packages/? >> >> pkg_info(1) does not seem to mention this limitation (or I have missed it). > > That's what is meant by "in the first repository of the package search > path" but it's not very obvious.
Ah, I see. Indeed I didn’t realise that was meant by the statement. > If PKG_PATH is not set and you're on a release version, the > pkg_add-based tools (including pkg_info) construct one starting with > the packages-stable directory, in order that -stable updates are > preferred over release packages. This is (mostly) described in > pkg_add(1). > > You can search just the release packages with > > PKG_PATH=http://cdn.openbsd.org/pub/OpenBSD/%v/packages/%a/ pkg_info -Q php Ok, thanks. Not very comfortable but at least a possibility. > >> Is this working as intended? > > Yes though it's a little unfriendly. Yep! > >> Is there a better way to look for available packages? > > I never found pkg_info -Q to be a useful tool. Up to now I never had an issue. But I never noticed this limitation before. (I did notice the lack of being able to search for partial package names but I have gotten used to that.) > Try pkglocate instead ("pkg_add pkglocatedb" first) which allows > searching on an index that is built from <pkgname>:<filename> - as a > result it lets you do a substring match on package names, not just > on filenames. > > For a package which includes many files you'll get a lot of output > lines, so something like "pkglocate moo | cut -d: -f1 | uniq" maybe > useful, or "pkglocate moo | grep ^moo". > > And if you're looking for the package containing a particular > binary, "pkglocate bin/moo" cuts out a lot of the useless stuff. Very helpful! Thanks Stuart! Mike