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

155 lines
3.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of Dpkg::Control::Info</TITLE>
</HEAD><BODY>
<H1>Dpkg::Control::Info</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::Info - parse files like debian/control
<A NAME="lbAC">&nbsp;</A>
<H2>DESCRIPTION</H2>
It provides an object to access data of files that follow the same
syntax as <I>debian/control</I>.
<A NAME="lbAD">&nbsp;</A>
<H2>METHODS</H2>
<DL COMPACT>
<DT id="1">$c = Dpkg::Control::Info-&gt;new(%opts)<DD>
Create a new Dpkg::Control::Info object. Loads the file from the filename
option, if no option is specified filename defaults to <I>debian/control</I>.
If a scalar is passed instead, it will be used as the filename. If filename
is ``-'', it parses the standard input. If filename is undef no loading will
be performed.
<DT id="2">$c-&gt;<B>reset()</B><DD>
Resets what got read.
<DT id="3">$c-&gt;parse($fh, $description)<DD>
Parse a control file from the given filehandle. Exits in case of errors.
<TT>$description</TT> is used to describe the filehandle, ideally it's a filename
or a description of where the data comes from. It is used in error messages.
The data in the object is reset before parsing new control files.
<DT id="4">$c-&gt;load($file)<DD>
Load the content of <TT>$file</TT>. Exits in case of errors. If file is ``-'', it
loads from the standard input.
<DT id="5">$c-&gt;[0]<DD>
<DT id="6">$c-&gt;<B>get_source()</B><DD>
Returns a Dpkg::Control object containing the fields concerning the
source package.
<DT id="7">$c-&gt;get_pkg_by_idx($idx)<DD>
Returns a Dpkg::Control object containing the fields concerning the binary
package numbered <TT>$idx</TT> (starting at 1).
<DT id="8">$c-&gt;get_pkg_by_name($name)<DD>
Returns a Dpkg::Control object containing the fields concerning the binary
package named <TT>$name</TT>.
<DT id="9">$c-&gt;<B>get_packages()</B><DD>
Returns a list containing the Dpkg::Control objects for all binary packages.
<DT id="10">$str = $c-&gt;output([$fh])<DD>
Return the content info into a string. If <TT>$fh</TT> is specified print it into
the filehandle.
<DT id="11">&quot;$c&quot;<DD>
Return a string representation of the content.
<DT id="12">@{$c}<DD>
Return a list of Dpkg::Control objects, the first one is corresponding to
source information and the following ones are the binary packages
information.
</DL>
<A NAME="lbAE">&nbsp;</A>
<H2>CHANGES</H2>
<A NAME="lbAF">&nbsp;</A>
<H3>Version 1.01 (dpkg 1.18.0)</H3>
New argument: The <TT>$c</TT>-&gt;<B>new()</B> constructor accepts an <TT>%opts</TT> argument.
<A NAME="lbAG">&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="13"><A HREF="#lbAB">NAME</A><DD>
<DT id="14"><A HREF="#lbAC">DESCRIPTION</A><DD>
<DT id="15"><A HREF="#lbAD">METHODS</A><DD>
<DT id="16"><A HREF="#lbAE">CHANGES</A><DD>
<DL>
<DT id="17"><A HREF="#lbAF">Version 1.01 (dpkg 1.18.0)</A><DD>
<DT id="18"><A HREF="#lbAG">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:39 GMT, March 31, 2021
</BODY>
</HTML>