1Dpkg::Control(3perl) libdpkg-perl Dpkg::Control(3perl)
2
3
4
6 Dpkg::Control - parse and manipulate official control-like information
7
9 The Dpkg::Control object is a smart version of Dpkg::Control::Hash. It
10 associates a type to the control information. That type can be used to
11 know what fields are allowed and in what order they must be output.
12
13 The types are constants that are exported by default. Here's the full
14 list:
15
16 CTRL_UNKNOWN
17 This type is the default type, it indicates that the type of
18 control information is not yet known.
19
20 CTRL_INFO_SRC
21 Corresponds to the first stanza in a debian/control file in a
22 Debian source package.
23
24 CTRL_INFO_PKG
25 Corresponds to subsequent stanza in a debian/control file in a
26 Debian source package.
27
28 CTRL_REPO_RELEASE
29 Corresponds to a Release file in a repository.
30
31 CTRL_INDEX_SRC
32 Corresponds to a stanza in a Sources file of a source package
33 repository.
34
35 CTRL_INDEX_PKG
36 Corresponds to a stanza in a Packages file of a binary package
37 repository.
38
39 CTRL_PKG_SRC
40 Corresponds to a .dsc file of a Debian source package.
41
42 CTRL_PKG_DEB
43 Corresponds to the control file generated by dpkg-gencontrol
44 (DEBIAN/control) and to the same file inside .deb packages.
45
46 CTRL_FILE_BUILDINFO
47 Corresponds to a .buildinfo file.
48
49 CTRL_FILE_CHANGES
50 Corresponds to a .changes file.
51
52 CTRL_FILE_VENDOR
53 Corresponds to a vendor file in $Dpkg::CONFDIR/origins/.
54
55 CTRL_FILE_STATUS
56 Corresponds to a stanza in dpkg's status file
57 ($Dpkg::ADMINDIR/status).
58
59 CTRL_CHANGELOG
60 Corresponds to the output of dpkg-parsechangelog.
61
62 CTRL_COPYRIGHT_HEADER
63 Corresponds to the header stanza in a debian/copyright file in
64 machine readable format.
65
66 CTRL_COPYRIGHT_FILES
67 Corresponds to a files stanza in a debian/copyright file in machine
68 readable format.
69
70 CTRL_COPYRIGHT_LICENSE
71 Corresponds to a license stanza in a debian/copyright file in
72 machine readable format.
73
74 CTRL_TESTS
75 Corresponds to a package tests control file in
76 debian/tests/control.
77
79 All the methods of Dpkg::Control::Hash are available. Those listed
80 below are either new or overridden with a different behaviour.
81
82 $c = Dpkg::Control->new(%opts)
83 If the "type" option is given, it's used to setup default values
84 for other options. See set_options() for more details.
85
86 $c->set_options(%opts)
87 Changes the value of one or more options. If the "type" option is
88 changed, it is used first to define default values for others
89 options. The option "allow_pgp" is set to 1 for CTRL_PKG_SRC,
90 CTRL_FILE_CHANGES and CTRL_REPO_RELEASE and to 0 otherwise. The
91 option "drop_empty" is set to 0 for CTRL_INFO_PKG and CTRL_INFO_SRC
92 and to 1 otherwise. The option "name" is set to a textual
93 description of the type of control information.
94
95 The output order is also set to match the ordered list returned by
96 Dpkg::Control::Fields::field_ordered_list($type).
97
98 $c->get_type()
99 Returns the type of control information stored. See the type
100 parameter set during new().
101
103 Version 1.03 (dpkg 1.18.11)
104 New type: CTRL_FILE_BUILDINFO.
105
106 Version 1.02 (dpkg 1.18.8)
107 New type: CTRL_TESTS.
108
109 Version 1.01 (dpkg 1.18.5)
110 New types: CTRL_REPO_RELEASE, CTRL_COPYRIGHT_HEADER,
111 CTRL_COPYRIGHT_FILES, CTRL_COPYRIGHT_LICENSE.
112
113 Version 1.00 (dpkg 1.15.6)
114 Mark the module as public.
115
116
117
1181.21.21 2023-07-19 Dpkg::Control(3perl)