Debbug...ackages(3pm)
π Debbugs::Packages(3pm) π (User Contributed Perl Documentation)
okay so bestie, welcome to Debbugs::Packages, the module that knows which binary package came from which source package and vice versa. debbugs binary/source package handling, no cap. let's get into it π¦
πΈ NAME πΈ
Debbugs::Packages β debbugs binary/source package handling, fr fr
β¨ DESCRIPTION β¨
okay so the Debbugs::Packages module hands you support functions that map binary packages to their corresponding source packages and the other way around too, because we're nothing if not bi-directional π
and like, quick context: this makes total sense for software distributions, where devs may work on a single source package which produces several binary packages for users to actually install. it just might not make sense in other contexts. iykyk π
π METHODS π
getpkgsrc
returns a reference to a hash of binary package names β‘οΈ their corresponding source package names. one-stop shop, obsessed. β¨
getpkgcomponent
returns a reference to a hash of binary package names β‘οΈ the component of the archive containing those binary packages (like "main", "contrib", "non-free"). know your neighborhood bestie ποΈ
getsrcpkgs
returns a list of the binary packages produced by a given source package. one source, many babies π«Ά
binary_to_source
binary_to_source(package => 'foo',
version => '1.2.3',
arch => 'i386');
turns a binary package (at optional version, in optional architecture) into a single source package (or a set of them), optionally with associated versions attached. glow-up pipeline π«
by default, in LIST context, it returns a LIST of array refs of source package / source version pairs corresponding to the binary package(s), arch(s), and version(s) you passed in.
in SCALAR context, only the corresponding source packages come back, concatenated with ', ' if there's more than one. cute little join, slay.
if no source can be found, it returns undef in scalar context, or the empty list in list context. so like, handle that, bestie π
binaryβ binary package name(s), as a SCALAR or an ARRAYREFversionβ binary package version(s), as a SCALAR or an ARRAYREF; optional, defaults to all versionsarchβ binary package architecture(s), as a SCALAR or an ARRAYREF; optional, defaults to all architecturessource_onlyβ return only the source name (forced on if you're in SCALAR context), defaults to falsescalar_onlyβ return a scalar only (forced true if in SCALAR context, and it also causessource_onlyto be true), defaults to falsecacheβ optional HASHREF to be used to cache results ofbinary_to_source. caching? we love her π
sourcetobinary
returns a list of references to triplets of binary package names, versions, and architectures corresponding to a given source package name and version.
and here's the plot twist π³: if the given source package name and version cannot be found in the database, but the source package name is in the unversioned package-to-source map file, then you get back a reference to a binary package name and version pair β without the architecture. no arch for you, sorry bestie π
getversions
returns versions of the package in a distribution at a specific architecture. short and sweet, we stan a minimal queen π
get_versions
get_versions(package=>'foopkg',
dist => 'unstable',
arch => 'i386',
);
returns a list of the versions of package in the distributions and architectures listed. and heads up: this routine only returns unique values β no duplicates, no repeats, periodt π
packageβ package to return the list of versions fordistβ distribution (unstable,stable,testing); can be an arrayrefarchβ architecture (i386,source, ...); can be an arrayreftimeβ returns aversion=>timehash of the time at which the newest package matching this version was uploadedsourceβ returnssource/versioninstead of just versionsno_source_archβ discards the source architecture whenarchis not passed. (used for finding the versions of binary packages only.) defaults to0, which does not discard the source architecture. β οΈ and this may change in the future, so if you care, please code accordingly, bestie β don't come for me later.return_archsβ returns aversion=>[archs]hash indicating which architectures are at which versionslargest_source_version_onlyβ if there is more than one source version in a particular distribution, discards all versions but the largest in that distribution. defaults to1, as this used to be the way that the Debian archive worked. nostalgia core π₯²
when called in scalar context, this function will return hashrefs or arrayrefs as appropriate; in list context, it will return paired lists or unpaired lists as appropriate. pick your fighter π₯
makesourceversions
@{$cgi_var{found}} = makesourceversions($cgi_var{package},undef,@{$cgi_var{found}});
canonicalizes versions into source versions, which have an explicitly named source package. this is the move for coping with source packages whose names have changed during their history, and with cases where source version numbers differ from binary version numbers. glow-up with a paper trail π
make_source_versions
make_source_versions(package => 'foo',
arch => 'source',
versions => '0.1.1',
guess_source => 1,
warnings => \$warnings,
);
an extended version of makesourceversions (which calls this function internally, btw) that allows for multiple packages, multiple architectures, and it outputs warnings and debugging information to the SCALARREFs or HANDLEs you provide. she's flexible π
the guess_source option determines whether the source package is guessed at if there is no obviously correct package. things that use this function for non-transient output should set this to false; things that use it for transient output can set this to true.
β οΈ currently it defaults to true, but that is not a sane option. i said what i said, bestie π
π¦ SEE ALSO π¦
nothing extra listed here bestie, this page is a self-contained queen π
and that's the whole page!! you're now officially fluent in binary β source package mapping β¨
sign-off cuteness: this lil doc came from perl v5.40.1, dated 2026-04-27, and yes the title bar says Debbugs::Packages(3pm) on both ends because she's consistent like that π go forth and map those packages, bestie π«Άππ¦
π¦ where this page comes from
- ubuntu stonking: libdebbugs-perl 2.6.5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms