OpenBSD::PackageName(3p)

OpenBSD::PackageName3p

Package names handling

Usage

   use OpenBSD::PackageName;
   $pkgname = OpenBSD::PackageName::url2pkgname($url);
   ($stem, $version, @flavors) = OpenBSD::PackageName::splitname($pkgname);
   $stem = OpenBSD::PackageName::splitstem($pkgname);
   OpenBSD::PackageName::is_stem($stem) == 1;
   OpenBSD::PackageName::is_stem($pkgname) == 0;
   @candidates = OpenBSD::PackageName::findstem($stem, @pkgnames);
   # alternate interface
   $h = OpenBSD::PackageName::compile_stemlist(@pkgnames);
   @candidates = $h->findstem($stem);

Overview

"OpenBSD::PackageName" is the canonical interface to package names handling.

OpenBSD::PackageName::url2pkgname($url)

strip an $url of path elements and ".tgz" suffixes, yield a canonicalized package name.

OpenBSD::PackageName::splitname($pkgname)

split a $pkgname into a $stem, a $version number, and a (possibly empty) list of @flavors components. If the name contains no identifiable version, $version will be "undef".

OpenBSD::PackageName::splitstem($pkgname)

short version of "splitname" that extracts only the $stem.

OpenBSD::PackageName::is_stem($string)

check whether a $string is a valid stem, as opposed to a full package name. Useful for commands that take either full names or stems, and need to reconstruct the full name from the stem.

"OpenBSD::PackageName::findstem($stem, @pkgnames)"

look up a $stem into a list of @pkgnames. Return a list of candidates for further processing.

OpenBSD::PackageName::compile_stemlist(@pkgnames)

alternate interface that is faster when lots of look ups are involved. Compile a list of @pkgnames into an object $h that can be queried using "$h->findstem($stem)".

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.