Commit | Line | Data |
---|---|---|
1479465f GJ |
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 | =cut | |
28 | ||
29 | use strict; | |
30 | use warnings; | |
31 | ||
32 | our $VERSION = '1.03'; | |
33 | our @EXPORT_OK = qw( | |
34 | $PROGNAME | |
35 | $PROGVERSION | |
36 | $PROGMAKE | |
37 | $PROGTAR | |
38 | $PROGPATCH | |
39 | $CONFDIR | |
40 | $ADMINDIR | |
41 | $LIBDIR | |
42 | $DATADIR | |
43 | ); | |
44 | our @EXPORT = qw( | |
45 | $version | |
46 | $progname | |
47 | $admindir | |
48 | $dpkglibdir | |
49 | $pkgdatadir | |
50 | ); | |
51 | ||
52 | use Exporter qw(import); | |
53 | ||
54 | =head1 VARIABLES | |
55 | ||
56 | =over 4 | |
57 | ||
58 | =item $Dpkg::PROGNAME | |
59 | ||
60 | Contains the name of the current program. | |
61 | ||
62 | =item $Dpkg::PROGVERSION | |
63 | ||
64 | Contains the version of the dpkg suite. | |
65 | ||
66 | =item $Dpkg::PROGMAKE | |
67 | ||
68 | Contains the name of the system GNU make program. | |
69 | ||
70 | =item $Dpkg::PROGTAR | |
71 | ||
72 | Contains the name of the system GNU tar program. | |
73 | ||
74 | =item $Dpkg::PROGPATCH | |
75 | ||
76 | Contains the name of the system GNU patch program (or another implementation | |
77 | that is directory traversal resistant). | |
78 | ||
79 | =item $Dpkg::CONFDIR | |
80 | ||
81 | Contains the path to the dpkg system configuration directory. | |
82 | ||
83 | =item $Dpkg::ADMINDIR | |
84 | ||
85 | Contains the path to the dpkg database directory. | |
86 | ||
87 | =item $Dpkg::LIBDIR | |
88 | ||
89 | Contains the path to the dpkg methods and plugins directory. | |
90 | ||
91 | =item $Dpkg::DATADIR | |
92 | ||
93 | Contains the path to the dpkg architecture tables directory. | |
94 | ||
95 | =back | |
96 | ||
97 | =cut | |
98 | ||
99 | our ($PROGNAME) = $0 =~ m{(?:.*/)?([^/]*)}; | |
100 | ||
101 | # The following lines are automatically fixed at install time | |
102 | our $PROGVERSION = '1.18.x'; | |
103 | our $PROGMAKE = $ENV{DPKG_PROGMAKE} // 'make'; | |
104 | our $PROGTAR = $ENV{DPKG_PROGTAR} // 'tar'; | |
105 | our $PROGPATCH = $ENV{DPKG_PROGPATCH} // 'patch'; | |
106 | ||
107 | our $CONFDIR = '/etc/dpkg'; | |
108 | our $ADMINDIR = '/var/lib/dpkg'; | |
109 | our $LIBDIR = '.'; | |
110 | our $DATADIR = '..'; | |
111 | ||
112 | $DATADIR = $ENV{DPKG_DATADIR} if defined $ENV{DPKG_DATADIR}; | |
113 | ||
114 | # XXX: Backwards compatibility, to be removed on VERSION 2.00. | |
115 | ## no critic (Variables::ProhibitPackageVars) | |
116 | our $version = $PROGVERSION; | |
117 | our $admindir = $ADMINDIR; | |
118 | our $dpkglibdir = $LIBDIR; | |
119 | our $pkgdatadir = $DATADIR; | |
120 | ## use critic | |
121 | ||
122 | =head1 CHANGES | |
123 | ||
124 | =head2 Version 1.03 (dpkg 1.18.24) | |
125 | ||
126 | New variable: $PROGPATCH. | |
127 | ||
128 | =head2 Version 1.02 (dpkg 1.18.11) | |
129 | ||
130 | New variable: $PROGTAR, $PROGMAKE. | |
131 | ||
132 | =head2 Version 1.01 (dpkg 1.17.0) | |
133 | ||
134 | New variables: $PROGNAME, $PROGVERSION, $CONFDIR, $ADMINDIR, $LIBDIR and | |
135 | $DATADIR. | |
136 | ||
137 | Deprecated variables: $version, $admindir, $dpkglibdir and $pkgdatadir. | |
138 | ||
139 | =head2 Version 1.00 (dpkg 1.15.6) | |
140 | ||
141 | Mark the module as public. | |
142 | ||
143 | =cut | |
144 | ||
145 | 1; |