NAME
OpenBSD::PackageName - package names handling
SYNOPSIS
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);
DESCRIPTION
"OpenBSD::PackageName" is the canonical interface to package names handling.
- OpenBSD::PackageName::url2pkgname($url)
-
strip an
$urlof path elements and".tgz"suffixes, yield a canonicalized package name.
- OpenBSD::PackageName::splitname($pkgname)
-
split a
$pkgnameinto a$stem, a$versionnumber, and a (possibly empty) list of@flavorscomponents. If the name contains no identifiable version,$versionwill be"undef".
- OpenBSD::PackageName::splitstem($pkgname)
-
short version of
"splitname"that extracts only the$stem.
- OpenBSD::PackageName::is_stem($string)
-
check whether a
$stringis 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
$steminto 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
@pkgnamesinto an object$hthat can be queried using"$h->findstem($stem)".