OpenBSD manual page server

Manual Page Search Parameters

OpenBSD::PackageName(3p) Perl Programmers Reference Guide OpenBSD::PackageName(3p)

OpenBSD::PackageName - package names handling

   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);

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

strip an $url of path elements and ".tgz" suffixes, yield a canonicalized package name.
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".
short version of "splitname" that extracts only the $stem.
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.
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)".
2020-12-20 perl v5.38.2