]> git.saurik.com Git - apt.git/commitdiff
* cmdline/apt-config.cc:
authorDavid Kalnischkies <kalnischkies@gmail.com>
Sun, 22 Apr 2012 10:29:24 +0000 (12:29 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Sun, 22 Apr 2012 10:29:24 +0000 (12:29 +0200)
  - make it possible to limit dump to a subtree
  - implement --empty and --format option for dump

cmdline/apt-config.cc
debian/changelog
doc/apt-config.8.xml
doc/apt-verbatim.ent

index 79ae944df1f8e0e2417789b4d535b04ddf2743aa..397ce32df71bead27ca4f62eb0b0ad280271e2c4 100644 (file)
@@ -63,7 +63,13 @@ bool DoShell(CommandLine &CmdL)
 /* */
 bool DoDump(CommandLine &CmdL)
 {
-   _config->Dump(cout);
+   bool const empty = _config->FindB("APT::Config::Dump::EmptyValue", true);
+   std::string const format = _config->Find("APT::Config::Dump::Format", "%f \"%v\";\n");
+   if (CmdL.FileSize() == 1)
+      _config->Dump(cout, NULL, format.c_str(), empty);
+   else
+      for (const char **I = CmdL.FileList + 1; *I != 0; ++I)
+        _config->Dump(cout, *I, format.c_str(), empty);
    return true;
 }
                                                                        /*}}}*/
@@ -100,6 +106,8 @@ int main(int argc,const char *argv[])                                       /*{{{*/
       {'v',"version","version",0},
       {'c',"config-file",0,CommandLine::ConfigFile},
       {'o',"option",0,CommandLine::ArbItem},
+      {0,"empty","APT::Config::Dump::EmptyValue",CommandLine::Boolean},
+      {0,"format","APT::Config::Dump::Format",CommandLine::HasArg},
       {0,0,0,0}};
    CommandLine::Dispatch Cmds[] = {{"shell",&DoShell},
                                    {"dump",&DoDump},
index 79c09b092e0d2b53b028f9cf4dd0b1c27f06d59f..97a7855fb3ef65dd3adfc2b74e0fae88efa69ed8 100644 (file)
@@ -7,8 +7,11 @@ apt (0.9.3) unstable; urgency=low
     - add a more versatile Dump() method
   * apt-pkg/acquire-worker.cc:
     - use Dump() to generate the configuration message for sending
+  * cmdline/apt-config.cc:
+    - make it possible to limit dump to a subtree
+    - implement --empty and --format option for dump
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Sun, 22 Apr 2012 12:28:13 +0200
+ -- David Kalnischkies <kalnischkies@gmail.com>  Sun, 22 Apr 2012 12:29:07 +0200
 
 apt (0.9.2) unstable; urgency=low
 
index b6fcf4bf29949bc3f060669693ddc04477ca6c02..94aeec0591c6b2108c07c49451d15f87daa7d39e 100644 (file)
@@ -85,7 +85,21 @@ eval $RES
    &apt-cmdblurb;
    
    <variablelist>
-   
+     <varlistentry>
+      <term><option>--empty</option></term>
+      <listitem><para>Include options which have an empty value. This is the default, so
+                     use --no-empty to remove them from the output.</para></listitem>
+     </varlistentry>
+
+     <varlistentry>
+      <term><option>--format '<replaceable>&percnt;f &#x0022;&percnt;v&#x0022;;&percnt;n</replaceable>'</option></term>
+      <listitem><para>Defines the output of each config option. &percnt;t will be replaced with the tagname,
+                     &percnt;f with the complete tagname and &percnt;v with the value of the option.
+                     Use uppercase letters and the respective values will be quoted. Additionally
+                     &percnt;n will be replaced by a newline, &percnt;N by a tab. A &percnt; can be
+                     printed by using &percnt;&percnt;.</para></listitem>
+     </varlistentry>
+
      &apt-commonoptions;
      
    </variablelist>
index ad4554e2f823f329e0563cb3e0fe1aeb52eac905..3846c17e3d47b0a91e460e8ccadbe0ec2af31f04 100644 (file)
                &synopsis-help;
        </group>
 </cmdsynopsis></refsynopsisdiv>">
+<!--<arg><option>- -format '<replaceable>&#37;f \"&#37;v\";&#37;n</replaceable>'</option></arg>-->
 <!ENTITY synopsis-command-apt-config "<refsynopsisdiv><cmdsynopsis>
        <command>apt-config</command>
+       <arg><option>--empty</option></arg>
+       <arg><option>--format '<replaceable>&percnt;f &#x0022;&percnt;v&#x0022;;&percnt;n</replaceable>'</option></arg>
        &synopsis-arg-option;
        &synopsis-arg-config;
        <group choice='req'>