man-pages/man3/Dpkg::Control.3perl.html
2021-03-31 01:06:50 +01:00

204 lines
5.4 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of Dpkg::Control</TITLE>
</HEAD><BODY>
<H1>Dpkg::Control</H1>
Section: libdpkg-perl (3perl)<BR>Updated: 2020-03-23<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
Dpkg::Control - parse and manipulate official control-like information
<A NAME="lbAC">&nbsp;</A>
<H2>DESCRIPTION</H2>
The Dpkg::Control object is a smart version of Dpkg::Control::Hash.
It associates a type to the control information. That type can be
used to know what fields are allowed and in what order they must be
output.
<P>
The types are constants that are exported by default. Here's the full
list:
<DL COMPACT>
<DT id="1"><FONT SIZE="-1">CTRL_UNKNOWN</FONT><DD>
This type is the default type, it indicates that the type of control
information is not yet known.
<DT id="2"><FONT SIZE="-1">CTRL_INFO_SRC</FONT><DD>
Corresponds to the first block of information in a <I>debian/control</I> file in
a Debian source package.
<DT id="3"><FONT SIZE="-1">CTRL_INFO_PKG</FONT><DD>
Corresponds to subsequent blocks of information in a <I>debian/control</I> file
in a Debian source package.
<DT id="4"><FONT SIZE="-1">CTRL_REPO_RELEASE</FONT><DD>
Corresponds to a <I>Release</I> file in a repository.
<DT id="5"><FONT SIZE="-1">CTRL_INDEX_SRC</FONT><DD>
Corresponds to an entry in a <I>Sources</I> file of a source package
repository.
<DT id="6"><FONT SIZE="-1">CTRL_INDEX_PKG</FONT><DD>
Corresponds to an entry in a <I>Packages</I> file of a binary package
repository.
<DT id="7"><FONT SIZE="-1">CTRL_PKG_SRC</FONT><DD>
Corresponds to a .dsc file of a Debian source package.
<DT id="8"><FONT SIZE="-1">CTRL_PKG_DEB</FONT><DD>
Corresponds to the <I>control</I> file generated by dpkg-gencontrol
(<I>DEBIAN/control</I>) and to the same file inside .deb packages.
<DT id="9"><FONT SIZE="-1">CTRL_FILE_BUILDINFO</FONT><DD>
Corresponds to a .buildinfo file.
<DT id="10"><FONT SIZE="-1">CTRL_FILE_CHANGES</FONT><DD>
Corresponds to a .changes file.
<DT id="11"><FONT SIZE="-1">CTRL_FILE_VENDOR</FONT><DD>
Corresponds to a vendor file in <TT>$Dpkg::CONFDIR</TT>/origins/.
<DT id="12"><FONT SIZE="-1">CTRL_FILE_STATUS</FONT><DD>
Corresponds to an entry in dpkg's <I>status</I> file ($Dpkg::ADMINDIR/status).
<DT id="13"><FONT SIZE="-1">CTRL_CHANGELOG</FONT><DD>
Corresponds to the output of dpkg-parsechangelog.
<DT id="14"><FONT SIZE="-1">CTRL_COPYRIGHT_HEADER</FONT><DD>
Corresponds to the header control block in a <I>debian/copyright</I> file in
machine readable format.
<DT id="15"><FONT SIZE="-1">CTRL_COPYRIGHT_FILES</FONT><DD>
Corresponds to a files control block in a <I>debian/copyright</I> file in
machine readable format.
<DT id="16"><FONT SIZE="-1">CTRL_COPYRIGHT_LICENSE</FONT><DD>
Corresponds to a license control block in a <I>debian/copyright</I> file in
machine readable format.
<DT id="17"><FONT SIZE="-1">CTRL_TESTS</FONT><DD>
Corresponds to a package tests control file in <I>debian/tests/control</I>.
</DL>
<A NAME="lbAD">&nbsp;</A>
<H2>METHODS</H2>
All the methods of Dpkg::Control::Hash are available. Those listed below
are either new or overridden with a different behaviour.
<DL COMPACT>
<DT id="18">$c = Dpkg::Control-&gt;new(%opts)<DD>
If the ``type'' option is given, it's used to setup default values
for other options. See <B>set_options()</B> for more details.
<DT id="19">$c-&gt;set_options(%opts)<DD>
Changes the value of one or more options. If the ``type'' option is changed,
it is used first to define default values for others options. The option
``allow_pgp'' is set to 1 for <FONT SIZE="-1">CTRL_PKG_SRC, CTRL_FILE_CHANGES</FONT> and
<FONT SIZE="-1">CTRL_REPO_RELEASE</FONT> and to 0 otherwise. The option ``drop_empty'' is set to 0
for <FONT SIZE="-1">CTRL_INFO_PKG</FONT> and <FONT SIZE="-1">CTRL_INFO_SRC</FONT> and to 1 otherwise. The option ``name''
is set to a textual description of the type of control information.
<P>
The output order is also set to match the ordered list returned by
Dpkg::Control::Fields::field_ordered_list($type).
<DT id="20">$c-&gt;<B>get_type()</B><DD>
Returns the type of control information stored. See the type parameter
set during <B>new()</B>.
</DL>
<A NAME="lbAE">&nbsp;</A>
<H2>CHANGES</H2>
<A NAME="lbAF">&nbsp;</A>
<H3>Version 1.03 (dpkg 1.18.11)</H3>
New type: <FONT SIZE="-1">CTRL_FILE_BUILDINFO.</FONT>
<A NAME="lbAG">&nbsp;</A>
<H3>Version 1.02 (dpkg 1.18.8)</H3>
New type: <FONT SIZE="-1">CTRL_TESTS.</FONT>
<A NAME="lbAH">&nbsp;</A>
<H3>Version 1.01 (dpkg 1.18.5)</H3>
New types: <FONT SIZE="-1">CTRL_REPO_RELEASE, CTRL_COPYRIGHT_HEADER, CTRL_COPYRIGHT_FILES,
CTRL_COPYRIGHT_LICENSE.</FONT>
<A NAME="lbAI">&nbsp;</A>
<H3>Version 1.00 (dpkg 1.15.6)</H3>
Mark the module as public.
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="21"><A HREF="#lbAB">NAME</A><DD>
<DT id="22"><A HREF="#lbAC">DESCRIPTION</A><DD>
<DT id="23"><A HREF="#lbAD">METHODS</A><DD>
<DT id="24"><A HREF="#lbAE">CHANGES</A><DD>
<DL>
<DT id="25"><A HREF="#lbAF">Version 1.03 (dpkg 1.18.11)</A><DD>
<DT id="26"><A HREF="#lbAG">Version 1.02 (dpkg 1.18.8)</A><DD>
<DT id="27"><A HREF="#lbAH">Version 1.01 (dpkg 1.18.5)</A><DD>
<DT id="28"><A HREF="#lbAI">Version 1.00 (dpkg 1.15.6)</A><DD>
</DL>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:38 GMT, March 31, 2021
</BODY>
</HTML>