OpenBSD::Search(3p)

OpenBSD::Search3p

Package names matching framework

Usage

   use OpenBSD::Search;
   # pkgspec objects
   my $search_object = OpenBSD::Search::PkgSpec->new($pattern);
   my $filter_object = OpenBSD::Search::Filter->keep_most_recent;
   # need repository to apply to
   use OpenBSD::PackageRepository::Installed;
   my $inst = OpenBSD::PackageRepository::Installed->new;
   my $list_ref = $inst->match_locations($search_object, $filter_object);

Overview

"OpenBSD::Search" provides a search infrastructure for "OpenBSD::PackageRepository" objects.

A given repository can be searched for existing packages using "$repo->match_locations($search1, $filter1, ...);"

It returns a reference to a list of matching "OpenBSD::PackageLocation" objects.

A repository list can be searched in a similar way: the search proceeds through each repository in the list, and stops as soon as it finds a non-empty match (similar to "ld -L" rules).

The first search object $search is used to find the basic set of matching packages, and further objects are used to weed out unwanted elements from the list.

Complex searches must be built as lists of filter objects, in order to preserve RepositoryList semantics, and ensure the correct non-empty first match is returned.

The infrastructure provides the following objects:

OpenBSD::Search::PkgSpec

"OpenBSD::PkgSpec" filters.

OpenBSD::Search::Stem

finds all packages with a given stem.

OpenBSD::Search::PartialStem

finds all packages including a partial stem.

OpenBSD::Search::Filter

filters package list through further tests.

Releases

32 releases since OpenBSD 5.0; the text changed 20 times.

  1. 5.0–5.3
  2. 5.4–5.5
  3. 5.6
  4. 5.7
  5. 5.8–5.9
  6. 6.0
  7. 6.1
  8. 6.2
  9. 6.3–6.4
  10. 6.5
  11. 6.6
  12. 6.7
  13. 6.8
  14. 6.9–7.2
  15. 7.3
  16. 7.4
  17. 7.5
  18. 7.6
  19. 7.7–7.8
  20. 7.9
  21. 8.0

From man 8.0-current-20261101 in OpenBSD 8.0-current (2026-11-01). Parsed by carta from the page's man source.