apt-config.8.xml 3.8 KB

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