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

205 lines
4.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of Dpkg::Conf</TITLE>
</HEAD><BODY>
<H1>Dpkg::Conf</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::Conf - parse dpkg configuration files
<A NAME="lbAC">&nbsp;</A>
<H2>DESCRIPTION</H2>
The Dpkg::Conf object can be used to read options from a configuration
file. It can export an array that can then be parsed exactly like <TT>@ARGV</TT>.
<A NAME="lbAD">&nbsp;</A>
<H2>METHODS</H2>
<DL COMPACT>
<DT id="1">$conf = Dpkg::Conf-&gt;new(%opts)<DD>
Create a new Dpkg::Conf object. Some options can be set through <TT>%opts:</TT>
if allow_short evaluates to true (it defaults to false), then short
options are allowed in the configuration file, they should be prepended
with a single hyphen.
<DT id="2">@$conf<DD>
<DT id="3">@options = $conf-&gt;<B>get_options()</B><DD>
Returns the list of options that can be parsed like <TT>@ARGV</TT>.
<DT id="4"><B>get()</B><DD>
<DT id="5"><B>set()</B><DD>
Obsolete functions, use <B>get_options()</B> instead. They will croak.
<DT id="6">$conf-&gt;load($file)<DD>
Read options from a file. Return the number of options parsed.
<DT id="7">$conf-&gt;load_system_config($file)<DD>
Read options from a system configuration file.
<P>
Return the number of options parsed.
<DT id="8">$conf-&gt;load_user_config($file)<DD>
Read options from a user configuration file. It will try to use the <FONT SIZE="-1">XDG</FONT>
directory, either <TT>$XDG_CONFIG_HOME</TT>/dpkg/ or <TT>$HOME</TT>/.config/dpkg/.
<P>
Return the number of options parsed.
<DT id="9">$conf-&gt;load_config($file)<DD>
Read options from system and user configuration files.
<P>
Return the number of options parsed.
<DT id="10">$conf-&gt;parse($fh)<DD>
Parse options from a file handle. When called multiple times, the parsed
options are accumulated.
<P>
Return the number of options parsed.
<DT id="11">$conf-&gt;filter(%opts)<DD>
Filter the list of options, either removing or keeping all those that
return true when <TT>$opts</TT>{remove}-&gt;($option) or <TT>$opts</TT>{keep}-&gt;($option) is called.
<DT id="12">$string = $conf-&gt;output([$fh])<DD>
Write the options in the given filehandle (if defined) and return a string
representation of the content (that would be) written.
<DT id="13">&quot;$conf&quot;<DD>
Return a string representation of the content.
<DT id="14">$conf-&gt;save($file)<DD>
Save the options in a file.
</DL>
<A NAME="lbAE">&nbsp;</A>
<H2>CHANGES</H2>
<A NAME="lbAF">&nbsp;</A>
<H3>Version 1.03 (dpkg 1.18.8)</H3>
Obsolete option: 'format_argv' in <TT>$conf</TT>-&gt;<B>filter()</B>.
<P>
Obsolete methods: <TT>$conf</TT>-&gt;<B>get()</B>, <TT>$conf</TT>-&gt;<B>set()</B>.
<P>
New methods: <TT>$conf</TT>-&gt;<B>load_system_config()</B>, <TT>$conf</TT>-&gt;<B>load_system_user()</B>,
<TT>$conf</TT>-&gt;<B>load_config()</B>.
<A NAME="lbAG">&nbsp;</A>
<H3>Version 1.02 (dpkg 1.18.5)</H3>
New option: Accept new option 'format_argv' in <TT>$conf</TT>-&gt;<B>filter()</B>.
<P>
New methods: <TT>$conf</TT>-&gt;<B>get()</B>, <TT>$conf</TT>-&gt;<B>set()</B>.
<A NAME="lbAH">&nbsp;</A>
<H3>Version 1.01 (dpkg 1.15.8)</H3>
New method: <TT>$conf</TT>-&gt;<B>filter()</B>
<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="15"><A HREF="#lbAB">NAME</A><DD>
<DT id="16"><A HREF="#lbAC">DESCRIPTION</A><DD>
<DT id="17"><A HREF="#lbAD">METHODS</A><DD>
<DT id="18"><A HREF="#lbAE">CHANGES</A><DD>
<DL>
<DT id="19"><A HREF="#lbAF">Version 1.03 (dpkg 1.18.8)</A><DD>
<DT id="20"><A HREF="#lbAG">Version 1.02 (dpkg 1.18.5)</A><DD>
<DT id="21"><A HREF="#lbAH">Version 1.01 (dpkg 1.15.8)</A><DD>
<DT id="22"><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>