apt-config.8.xml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <?xml version="1.0" encoding="utf-8" standalone="no"?>
  2. <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
  4. <!ENTITY % aptent SYSTEM "apt.ent">
  5. %aptent;
  6. <!ENTITY % aptverbatiment SYSTEM "apt-verbatim.ent">
  7. %aptverbatiment;
  8. ]>
  9. <refentry>
  10. <refentryinfo>
  11. &apt-author.jgunthorpe;
  12. &apt-author.team;
  13. &apt-email;
  14. &apt-product;
  15. <!-- The last update date -->
  16. <date>2012-05-11T00:00:00Z</date>
  17. </refentryinfo>
  18. <refmeta>
  19. <refentrytitle>apt-config</refentrytitle>
  20. <manvolnum>8</manvolnum>
  21. <refmiscinfo class="manual">APT</refmiscinfo>
  22. </refmeta>
  23. <!-- Man page title -->
  24. <refnamediv>
  25. <refname>apt-config</refname>
  26. <refpurpose>APT Configuration Query program</refpurpose>
  27. </refnamediv>
  28. &synopsis-command-apt-config;
  29. <refsect1><title>Description</title>
  30. <para><command>apt-config</command> is an internal program used by various
  31. portions of the APT suite to provide consistent configurability. It accesses
  32. the main configuration file <filename>/etc/apt/apt.conf</filename> in a
  33. manner that is easy to use by scripted applications.</para>
  34. <para>Unless the <option>-h</option>, or <option>--help</option> option is
  35. given, one of the commands below must be present.
  36. </para>
  37. <variablelist>
  38. <varlistentry><term><option>shell</option></term>
  39. <listitem><para>
  40. shell is used to access the configuration information from a shell
  41. script. It is given pairs of arguments, the first being a shell
  42. variable and the second the configuration value to query. As output
  43. it lists a series of shell assignments commands for each present value.
  44. In a shell script it should be used like:
  45. </para>
  46. <informalexample><programlisting>
  47. OPTS="-f"
  48. RES=`apt-config shell OPTS MyApp::options`
  49. eval $RES
  50. </programlisting></informalexample>
  51. <para>This will set the shell environment variable $OPTS to the value of
  52. MyApp::options with a default of <option>-f</option>.</para>
  53. <para>The configuration item may be postfixed with a /[fdbi]. f returns
  54. file names, d returns directories, b returns true or false and i returns
  55. an integer. Each of the returns is normalized and verified
  56. internally.</para>
  57. </listitem>
  58. </varlistentry>
  59. <varlistentry><term><option>dump</option></term>
  60. <listitem><para>
  61. Just show the contents of the configuration space.</para>
  62. </listitem>
  63. </varlistentry>
  64. </variablelist>
  65. </refsect1>
  66. <refsect1><title>options</title>
  67. &apt-cmdblurb;
  68. <variablelist>
  69. <varlistentry>
  70. <term><option>--empty</option></term>
  71. <listitem><para>Include options which have an empty value. This is the default, so
  72. use --no-empty to remove them from the output.</para></listitem>
  73. </varlistentry>
  74. <varlistentry>
  75. <term><option>--format '<replaceable>&percnt;f &#x0022;&percnt;v&#x0022;;&percnt;n</replaceable>'</option></term>
  76. <listitem><para>Defines the output of each config option. &percnt;t will be replaced with the name of the option,
  77. &percnt;f with the complete optionname and &percnt;v with the value of the option.
  78. Use uppercase letters and special characters in the value will be encoded to ensure that
  79. it can e.g. be savely used in a quoted-string as defined by RFC822. Additionally
  80. &percnt;n will be replaced by a newline, &percnt;N by a tab. A &percnt; can be
  81. printed by using &percnt;&percnt;.</para></listitem>
  82. </varlistentry>
  83. &apt-commonoptions;
  84. </variablelist>
  85. </refsect1>
  86. <refsect1><title>See Also</title>
  87. <para>&apt-conf;
  88. </para>
  89. </refsect1>
  90. <refsect1><title>Diagnostics</title>
  91. <para><command>apt-config</command> returns zero on normal operation, decimal 100 on error.
  92. </para>
  93. </refsect1>
  94. &manbugs;
  95. </refentry>