line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
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 . |
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
|
563
|
|
|
563
|
|
5183
|
use strict; |
|
563
|
|
|
|
|
604
|
|
|
563
|
|
|
|
|
16363
|
|
32
|
563
|
|
|
563
|
|
2813
|
use warnings; |
|
563
|
|
|
|
|
647
|
|
|
563
|
|
|
|
|
29756
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
our $VERSION = '2.00'; |
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
|
|
|
|
|
|
|
|
47
|
563
|
|
|
563
|
|
2883
|
use Exporter qw(import); |
|
563
|
|
|
|
|
597
|
|
|
563
|
|
|
|
|
115433
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 VARIABLES |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=over 4 |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=item $Dpkg::PROGNAME |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Contains the name of the current program. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=item $Dpkg::PROGVERSION |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Contains the version of the dpkg suite. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=item $Dpkg::PROGMAKE |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Contains the name of the system GNU make program. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=item $Dpkg::PROGTAR |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Contains the name of the system GNU tar program. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=item $Dpkg::PROGPATCH |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Contains the name of the system GNU patch program (or another implementation |
72
|
|
|
|
|
|
|
that is directory traversal resistant). |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=item $Dpkg::CONFDIR |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Contains the path to the dpkg system configuration directory. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=item $Dpkg::ADMINDIR |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Contains the path to the dpkg database directory. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=item $Dpkg::LIBDIR |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Contains the path to the dpkg methods and plugins directory. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=item $Dpkg::DATADIR |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Contains the path to the dpkg architecture tables directory. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=back |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=cut |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
our ($PROGNAME) = $0 =~ m{(?:.*/)?([^/]*)}; |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
# The following lines are automatically fixed at install time |
97
|
|
|
|
|
|
|
our $PROGVERSION = '1.20.6'; |
98
|
|
|
|
|
|
|
our $PROGMAKE = '/usr/bin/make'; |
99
|
|
|
|
|
|
|
our $PROGTAR = '/bin/tar'; |
100
|
|
|
|
|
|
|
our $PROGPATCH = '/usr/bin/patch'; |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
our $CONFDIR = '/etc/dpkg'; |
103
|
|
|
|
|
|
|
our $ADMINDIR = '/var/lib/dpkg'; |
104
|
|
|
|
|
|
|
our $LIBDIR = '/usr/lib/dpkg'; |
105
|
|
|
|
|
|
|
our $DATADIR = '/usr/share/dpkg'; |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
$DATADIR = $ENV{DPKG_DATADIR} if defined $ENV{DPKG_DATADIR}; |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head1 MODULES |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
The following is the list of public modules within the Dpkg hierarchy. Only |
112
|
|
|
|
|
|
|
modules with versions 1.00 or higher, and only the interfaces documented in |
113
|
|
|
|
|
|
|
their POD are considered public. |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=over |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=item L |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
This module, core variables. |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=item L |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
Architecture handling functions. |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=item L |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
Build information functions. |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=item L |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
Set, modify and query compilation build flags. |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=item L |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
Parse and manipulate B. |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=item L |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
Parse and manipulate build profiles. |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=item L |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
Parse changelogs. |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=item L |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
Represents a changelog entry. |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=item L |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
Generic changelog parser for F. |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=item L |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
Generate and parse checksums. |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=item L |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
Simple database of available compression methods. |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=item L |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
Transparently compress and decompress files. |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=item L |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
Wrapper around compression tools. |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=item L |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
Parse F configuration files. |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=item L |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
Parse and manipulate Debian control information (F<.dsc>, F<.changes>, |
176
|
|
|
|
|
|
|
F/F entries, etc.). |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
=item L |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
Represent fields output by F. |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
=item L |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
Manage (list of known) control fields. |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
=item L |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
Parse and manipulate a block of RFC822-like fields. |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=item L |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
Parse files like F. |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
=item L |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
Parse files like F. |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
=item L |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
Represents a F stanza. |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
=item L |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
Parse and manipulate dependencies. |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
=item L |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
Represents a single dependency statement. |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
=item L |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
Base module to represent multiple dependencies. |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
=item L |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
List of unrelated dependencies. |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
=item L |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
List of AND dependencies. |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
=item L |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
List of OR dependencies. |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
=item L |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
List of installed and virtual packages. |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
=item L |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
Push, pop and run exit handlers. |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
=item L |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
Wrapper around L. |
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
=item L |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
Spawn sub-processes and feed/retrieve data. |
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
=item L |
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
Collections of L (F/F files for example). |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
=item L |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
Base object serializer. |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
=item L |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
Common path handling functions. |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
=item L |
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
Parse and manipulate debian/source/format files. |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
=item L |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
Extract Debian source packages. |
261
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
=item L |
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
Substitute variables in strings. |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
=item L |
267
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
Identify current distribution vendor. |
269
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
=item L |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
Parse and manipulate Debian package versions. |
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
=back |
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
=head1 CHANGES |
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
=head2 Version 2.00 (dpkg 1.20.0) |
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
Remove variables: $version, $progname, $admindir, $dpkglibdir and $pkgdatadir. |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
=head2 Version 1.03 (dpkg 1.18.24) |
283
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
New variable: $PROGPATCH. |
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
=head2 Version 1.02 (dpkg 1.18.11) |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
New variable: $PROGTAR, $PROGMAKE. |
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
=head2 Version 1.01 (dpkg 1.17.0) |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
New variables: $PROGNAME, $PROGVERSION, $CONFDIR, $ADMINDIR, $LIBDIR and |
293
|
|
|
|
|
|
|
$DATADIR. |
294
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
Deprecated variables: $version, $admindir, $dpkglibdir and $pkgdatadir. |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
=head2 Version 1.00 (dpkg 1.15.6) |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
Mark the module as public. |
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
=head1 LICENSE |
302
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
See the header comment on each module for their particular license. |
304
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
=cut |
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
1; |