Scroll to navigation

Debbugs::Packages(3pm) User Contributed Perl Documentation Debbugs::Packages(3pm)

NAME

Debbugs::Packages - debbugs binary/source package handling

DESCRIPTION

The Debbugs::Packages module provides support functions to map binary packages to their corresponding source packages and vice versa. (This makes sense for software distributions, where developers may work on a single source package which produces several binary packages for use by users; it may not make sense in other contexts.)

METHODS

getpkgsrc

Returns a reference to a hash of binary package names to their corresponding source package names.

getpkgcomponent

Returns a reference to a hash of binary package names to the component of the archive containing those binary packages (e.g. "main", "contrib", "non-free").

getsrcpkgs

Returns a list of the binary packages produced by a given source package.

binary_to_source

     binary_to_source(package => 'foo',
                      version => '1.2.3',
                      arch    => 'i386');

Turn a binary package (at optional version in optional architecture) into a single (or set) of source packages (optionally) with associated versions.

By default, in LIST context, returns a LIST of array refs of source package, source version pairs corresponding to the binary package(s), arch(s), and verion(s) passed.

In SCALAR context, only the corresponding source packages are returned, concatenated with ', ' if necessary.

If no source can be found, returns undef in scalar context, or the empty list in list context.

sourcetobinary

Returns a list of references to triplets of binary package names, versions, and architectures corresponding to a given source package name and version. 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 a reference to a binary package name and version pair will be returned, without the architecture.

getversions

Returns versions of the package in a distribution at a specific architecture

get_versions

     get_versions(package=>'foopkg',
                  dist => 'unstable',
                  arch => 'i386',
                 );

Returns a list of the versions of package in the distributions and architectures listed. This routine only returns unique values.

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.

makesourceversions

     @{$cgi_var{found}} = makesourceversions($cgi_var{package},undef,@{$cgi_var{found}});

Canonicalize versions into source versions, which have an explicitly named source package. This is used to cope with source packages whose names have changed during their history, and with cases where source version numbers differ from binary version numbers.

make_source_versions

     make_source_versions(package => 'foo',
                          arch    => 'source',
                          versions => '0.1.1',
                          guess_source => 1,
                          debug    => \$debug,
                          warnings => \$warnings,
                         );

An extended version of makesourceversions (which calls this function internally) that allows for multiple packages, architectures, and outputs warnings and debugging information to provided SCALARREFs or HANDLEs.

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.

2010-08-06 perl v5.10.0