"Fossies" - the Fresh Open Source Software Archive

Member "dpkg-1.19.7/scripts/Dpkg.pm" (19 Apr 2019, 6022 Bytes) of package /linux/misc/dpkg_1.19.7.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "Dpkg.pm" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 1.19.2_vs_1.19.3.

    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 
   14 package Dpkg;
   15 
   16 =encoding utf8
   17 
   18 =head1 NAME
   19 
   20 Dpkg - module with core variables
   21 
   22 =head1 DESCRIPTION
   23 
   24 The Dpkg module provides a set of variables with information concerning
   25 this system installation.
   26 
   27 It is also the entry point to the Dpkg module hierarchy.
   28 
   29 =cut
   30 
   31 use strict;
   32 use warnings;
   33 
   34 our $VERSION = '1.03';
   35 our @EXPORT_OK = qw(
   36     $PROGNAME
   37     $PROGVERSION
   38     $PROGMAKE
   39     $PROGTAR
   40     $PROGPATCH
   41     $CONFDIR
   42     $ADMINDIR
   43     $LIBDIR
   44     $DATADIR
   45 );
   46 our @EXPORT = qw(
   47     $version
   48     $progname
   49     $admindir
   50     $dpkglibdir
   51     $pkgdatadir
   52 );
   53 
   54 use Exporter qw(import);
   55 
   56 =head1 VARIABLES
   57 
   58 =over 4
   59 
   60 =item $Dpkg::PROGNAME
   61 
   62 Contains the name of the current program.
   63 
   64 =item $Dpkg::PROGVERSION
   65 
   66 Contains the version of the dpkg suite.
   67 
   68 =item $Dpkg::PROGMAKE
   69 
   70 Contains the name of the system GNU make program.
   71 
   72 =item $Dpkg::PROGTAR
   73 
   74 Contains the name of the system GNU tar program.
   75 
   76 =item $Dpkg::PROGPATCH
   77 
   78 Contains the name of the system GNU patch program (or another implementation
   79 that is directory traversal resistant).
   80 
   81 =item $Dpkg::CONFDIR
   82 
   83 Contains the path to the dpkg system configuration directory.
   84 
   85 =item $Dpkg::ADMINDIR
   86 
   87 Contains the path to the dpkg database directory.
   88 
   89 =item $Dpkg::LIBDIR
   90 
   91 Contains the path to the dpkg methods and plugins directory.
   92 
   93 =item $Dpkg::DATADIR
   94 
   95 Contains the path to the dpkg architecture tables directory.
   96 
   97 =back
   98 
   99 =cut
  100 
  101 our ($PROGNAME) = $0 =~ m{(?:.*/)?([^/]*)};
  102 
  103 # The following lines are automatically fixed at install time
  104 our $PROGVERSION = '1.19.x';
  105 our $PROGMAKE = $ENV{DPKG_PROGMAKE} // 'make';
  106 our $PROGTAR = $ENV{DPKG_PROGTAR} // 'tar';
  107 our $PROGPATCH = $ENV{DPKG_PROGPATCH} // 'patch';
  108 
  109 our $CONFDIR = '/etc/dpkg';
  110 our $ADMINDIR = '/var/lib/dpkg';
  111 our $LIBDIR = '.';
  112 our $DATADIR = '../data';
  113 
  114 $DATADIR = $ENV{DPKG_DATADIR} if defined $ENV{DPKG_DATADIR};
  115 
  116 # XXX: Backwards compatibility, to be removed on VERSION 2.00.
  117 ## no critic (Variables::ProhibitPackageVars)
  118 our $version = $PROGVERSION;
  119 our $admindir = $ADMINDIR;
  120 our $dpkglibdir = $LIBDIR;
  121 our $pkgdatadir = $DATADIR;
  122 ## use critic
  123 
  124 =head1 MODULES
  125 
  126 The following is the list of public modules within the Dpkg hierarchy. Only
  127 modules with versions 1.00 or higher, and only the interfaces documented in
  128 their POD are considered public.
  129 
  130 =over
  131 
  132 =item L<Dpkg>
  133 
  134 This module, core variables.
  135 
  136 =item L<Dpkg::Arch>
  137 
  138 Architecture handling functions.
  139 
  140 =item L<Dpkg::Build::Info>
  141 
  142 Build information functions.
  143 
  144 =item L<Dpkg::BuildFlags>
  145 
  146 Set, modify and query compilation build flags.
  147 
  148 =item L<Dpkg::BuildOptions>
  149 
  150 Parse and manipulate B<DEB_BUILD_OPTIONS>.
  151 
  152 =item L<Dpkg::BuildProfiles>
  153 
  154 Parse and manipulate build profiles.
  155 
  156 =item L<Dpkg::Changelog>
  157 
  158 Parse changelogs.
  159 
  160 =item L<Dpkg::Changelog::Entry>
  161 
  162 Represents a changelog entry.
  163 
  164 =item L<Dpkg::Changelog::Parse>
  165 
  166 Generic changelog parser for F<dpkg-parsechangelog>.
  167 
  168 =item L<Dpkg::Checksums>
  169 
  170 Generate and parse checksums.
  171 
  172 =item L<Dpkg::Compression>
  173 
  174 Simple database of available compression methods.
  175 
  176 =item L<Dpkg::Compression::FileHandle>
  177 
  178 Transparently compress and decompress files.
  179 
  180 =item L<Dpkg::Compression::Process>
  181 
  182 Wrapper around compression tools.
  183 
  184 =item L<Dpkg::Conf>
  185 
  186 Parse F<dpkg> configuration files.
  187 
  188 =item L<Dpkg::Control>
  189 
  190 Parse and manipulate Debian control information (F<.dsc>, F<.changes>,
  191 F<Packages>/F<Sources> entries, etc.).
  192 
  193 =item L<Dpkg::Control::Changelog>
  194 
  195 Represent fields output by F<dpkg-parsechangelog>.
  196 
  197 =item L<Dpkg::Control::Fields>
  198 
  199 Manage (list of known) control fields.
  200 
  201 =item L<Dpkg::Control::Hash>
  202 
  203 Parse and manipulate a block of RFC822-like fields.
  204 
  205 =item L<Dpkg::Control::Info>
  206 
  207 Parse files like F<debian/control>.
  208 
  209 =item L<Dpkg::Control::Tests>
  210 
  211 Parse files like F<debian/tests/control>.
  212 
  213 =item L<Dpkg::Control::Tests::Entry>
  214 
  215 Represents a F<debian/tests/control> stanza.
  216 
  217 =item L<Dpkg::Deps>
  218 
  219 Parse and manipulate dependencies.
  220 
  221 =item L<Dpkg::Deps::Simple>
  222 
  223 Represents a single dependency statement.
  224 
  225 =item L<Dpkg::Deps::Multiple>
  226 
  227 Base module to represent multiple dependencies.
  228 
  229 =item L<Dpkg::Deps::Union>
  230 
  231 List of unrelated dependencies.
  232 
  233 =item L<Dpkg::Deps::AND>
  234 
  235 List of AND dependencies.
  236 
  237 =item L<Dpkg::Deps::OR>
  238 
  239 List of OR dependencies.
  240 
  241 =item L<Dpkg::Deps::KnownFacts>
  242 
  243 List of installed and virtual packages.
  244 
  245 =item L<Dpkg::Exit>
  246 
  247 Push, pop and run exit handlers.
  248 
  249 =item L<Dpkg::Gettext>
  250 
  251 Wrapper around L<Locale::gettext>.
  252 
  253 =item L<Dpkg::IPC>
  254 
  255 Spawn sub-processes and feed/retrieve data.
  256 
  257 =item L<Dpkg::Index>
  258 
  259 Collections of L<Dpkg::Control> (F<Packages>/F<Sources> files for example).
  260 
  261 =item L<Dpkg::Interface::Storable>
  262 
  263 Base object serializer.
  264 
  265 =item L<Dpkg::Path>
  266 
  267 Common path handling functions.
  268 
  269 =item L<Dpkg::Source::Format>
  270 
  271 Parse and manipulate debian/source/format files.
  272 
  273 =item L<Dpkg::Source::Package>
  274 
  275 Extract Debian source packages.
  276 
  277 =item L<Dpkg::Substvars>
  278 
  279 Substitute variables in strings.
  280 
  281 =item L<Dpkg::Vendor>
  282 
  283 Identify current distribution vendor.
  284 
  285 =item L<Dpkg::Version>
  286 
  287 Parse and manipulate Debian package versions.
  288 
  289 =back
  290 
  291 =head1 CHANGES
  292 
  293 =head2 Version 1.03 (dpkg 1.18.24)
  294 
  295 New variable: $PROGPATCH.
  296 
  297 =head2 Version 1.02 (dpkg 1.18.11)
  298 
  299 New variable: $PROGTAR, $PROGMAKE.
  300 
  301 =head2 Version 1.01 (dpkg 1.17.0)
  302 
  303 New variables: $PROGNAME, $PROGVERSION, $CONFDIR, $ADMINDIR, $LIBDIR and
  304 $DATADIR.
  305 
  306 Deprecated variables: $version, $admindir, $dpkglibdir and $pkgdatadir.
  307 
  308 =head2 Version 1.00 (dpkg 1.15.6)
  309 
  310 Mark the module as public.
  311 
  312 =cut
  313 
  314 1;