File Coverage

File:Dpkg.pm
Coverage:100.0%

linestmtbrancondsubpodtimecode
1# This program is free software; you can redistribute it and/or modify
2# it under the terms of the GNU General Public License as published by
3# the Free Software Foundation; either version 2 of the License, or
4# (at your option) any later version.
5#
6# This program is distributed in the hope that it will be useful,
7# but WITHOUT ANY WARRANTY; without even the implied warranty of
8# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9# GNU General Public License for more details.
10#
11# You should have received a copy of the GNU General Public License
12# along with this program.  If not, see <https://www.gnu.org/licenses/>.
13
14package Dpkg;
15
16=encoding utf8
17
18 - 29
=head1 NAME

Dpkg - module with core variables

=head1 DESCRIPTION

The Dpkg module provides a set of variables with information concerning
this system installation.

It is also the entry point to the Dpkg module hierarchy.

=cut
30
31
640
640
640
1279
48
6440
use strict;
32
640
640
640
696
121
18747
use warnings;
33
34our $VERSION = '2.00';
35our @EXPORT_OK = qw(
36    $PROGNAME
37    $PROGVERSION
38    $PROGMAKE
39    $PROGTAR
40    $PROGPATCH
41    $CONFDIR
42    $ADMINDIR
43    $LIBDIR
44    $DATADIR
45);
46
47
640
640
640
806
623
59140
use Exporter qw(import);
48
49 - 92
=head1 VARIABLES

=over 4

=item $Dpkg::PROGNAME

Contains the name of the current program.

=item $Dpkg::PROGVERSION

Contains the version of the dpkg suite.

=item $Dpkg::PROGMAKE

Contains the name of the system GNU make program.

=item $Dpkg::PROGTAR

Contains the name of the system GNU tar program.

=item $Dpkg::PROGPATCH

Contains the name of the system GNU patch program (or another implementation
that is directory traversal resistant).

=item $Dpkg::CONFDIR

Contains the path to the dpkg system configuration directory.

=item $Dpkg::ADMINDIR

Contains the path to the dpkg database directory.

=item $Dpkg::LIBDIR

Contains the path to the dpkg methods and plugins directory.

=item $Dpkg::DATADIR

Contains the path to the dpkg architecture tables directory.

=back

=cut
93
94our ($PROGNAME) = $0 =~ m{(?:.*/)?([^/]*)};
95
96# The following lines are automatically fixed at install time
97our $PROGVERSION = '1.21.x';
98our $PROGMAKE = $ENV{DPKG_PROGMAKE} // 'make';
99our $PROGTAR = $ENV{DPKG_PROGTAR} // 'tar';
100our $PROGPATCH = $ENV{DPKG_PROGPATCH} // 'patch';
101
102our $CONFDIR = '/etc/dpkg';
103our $ADMINDIR = '/var/lib/dpkg';
104our $LIBDIR = '.';
105our $DATADIR = '../data';
106
107$DATADIR = $ENV{DPKG_DATADIR} if defined $ENV{DPKG_DATADIR};
108
109 - 305
=head1 MODULES

The following is the list of public modules within the Dpkg hierarchy. Only
modules with versions 1.00 or higher, and only the interfaces documented in
their POD are considered public.

=over

=item L<Dpkg>

This module, core variables.

=item L<Dpkg::Arch>

Architecture handling functions.

=item L<Dpkg::Build::Info>

Build information functions.

=item L<Dpkg::BuildFlags>

Set, modify and query compilation build flags.

=item L<Dpkg::BuildOptions>

Parse and manipulate B<DEB_BUILD_OPTIONS>.

=item L<Dpkg::BuildProfiles>

Parse and manipulate build profiles.

=item L<Dpkg::Changelog>

Parse changelogs.

=item L<Dpkg::Changelog::Entry>

Represents a changelog entry.

=item L<Dpkg::Changelog::Parse>

Generic changelog parser for F<dpkg-parsechangelog>.

=item L<Dpkg::Checksums>

Generate and parse checksums.

=item L<Dpkg::Compression>

Simple database of available compression methods.

=item L<Dpkg::Compression::FileHandle>

Transparently compress and decompress files.

=item L<Dpkg::Compression::Process>

Wrapper around compression tools.

=item L<Dpkg::Conf>

Parse F<dpkg> configuration files.

=item L<Dpkg::Control>

Parse and manipulate Debian control information (F<.dsc>, F<.changes>,
F<Packages>/F<Sources> entries, etc.).

=item L<Dpkg::Control::Changelog>

Represent fields output by F<dpkg-parsechangelog>.

=item L<Dpkg::Control::Fields>

Manage (list of known) control fields.

=item L<Dpkg::Control::Hash>

Parse and manipulate a block of RFC822-like fields.

=item L<Dpkg::Control::Info>

Parse files like F<debian/control>.

=item L<Dpkg::Control::Tests>

Parse files like F<debian/tests/control>.

=item L<Dpkg::Control::Tests::Entry>

Represents a F<debian/tests/control> stanza.

=item L<Dpkg::Deps>

Parse and manipulate dependencies.

=item L<Dpkg::Deps::Simple>

Represents a single dependency statement.

=item L<Dpkg::Deps::Multiple>

Base module to represent multiple dependencies.

=item L<Dpkg::Deps::Union>

List of unrelated dependencies.

=item L<Dpkg::Deps::AND>

List of AND dependencies.

=item L<Dpkg::Deps::OR>

List of OR dependencies.

=item L<Dpkg::Deps::KnownFacts>

List of installed and virtual packages.

=item L<Dpkg::Exit>

Push, pop and run exit handlers.

=item L<Dpkg::Gettext>

Wrapper around L<Locale::gettext>.

=item L<Dpkg::IPC>

Spawn sub-processes and feed/retrieve data.

=item L<Dpkg::Index>

Collections of L<Dpkg::Control> (F<Packages>/F<Sources> files for example).

=item L<Dpkg::Interface::Storable>

Base object serializer.

=item L<Dpkg::Path>

Common path handling functions.

=item L<Dpkg::Source::Format>

Parse and manipulate debian/source/format files.

=item L<Dpkg::Source::Package>

Extract Debian source packages.

=item L<Dpkg::Substvars>

Substitute variables in strings.

=item L<Dpkg::Vendor>

Identify current distribution vendor.

=item L<Dpkg::Version>

Parse and manipulate Debian package versions.

=back

=head1 CHANGES

=head2 Version 2.00 (dpkg 1.20.0)

Remove variables: $version, $progname, $admindir, $dpkglibdir and $pkgdatadir.

=head2 Version 1.03 (dpkg 1.18.24)

New variable: $PROGPATCH.

=head2 Version 1.02 (dpkg 1.18.11)

New variable: $PROGTAR, $PROGMAKE.

=head2 Version 1.01 (dpkg 1.17.0)

New variables: $PROGNAME, $PROGVERSION, $CONFDIR, $ADMINDIR, $LIBDIR and
$DATADIR.

Deprecated variables: $version, $admindir, $dpkglibdir and $pkgdatadir.

=head2 Version 1.00 (dpkg 1.15.6)

Mark the module as public.

=head1 LICENSE

See the header comment on each module for their particular license.

=cut
306
3071;