Bläddra i källkod

_config->Dump is now inlined, and calls Dump(clog). Du...
Author: doogie
Date: 2002-11-09 17:11:25 GMT
_config->Dump is now inlined, and calls Dump(clog). Dump(ostream&) is now
exported. Fixed apt-config dump sending to stderr.

Arch Librarian 22 år sedan
förälder
incheckning
ff2a211aec
4 ändrade filer med 10 tillägg och 7 borttagningar
  1. 3 3
      apt-pkg/contrib/configuration.cc
  2. 4 2
      apt-pkg/contrib/configuration.h
  3. 2 2
      cmdline/apt-config.cc
  4. 1 0
      debian/changelog

+ 3 - 3
apt-pkg/contrib/configuration.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: configuration.cc,v 1.23 2002/09/14 05:29:22 jgg Exp $
+// $Id: configuration.cc,v 1.24 2002/11/09 17:11:25 doogie Exp $
 /* ######################################################################
 /* ######################################################################
 
 
    Configuration Class
    Configuration Class
@@ -397,14 +397,14 @@ bool Configuration::ExistsAny(const char *Name) const
 // Configuration::Dump - Dump the config				/*{{{*/
 // Configuration::Dump - Dump the config				/*{{{*/
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
 /* Dump the entire configuration space */
 /* Dump the entire configuration space */
-void Configuration::Dump()
+void Configuration::Dump(ostream& str)
 {
 {
    /* Write out all of the configuration directives by walking the 
    /* Write out all of the configuration directives by walking the 
       configuration tree */
       configuration tree */
    const Configuration::Item *Top = Tree(0);
    const Configuration::Item *Top = Tree(0);
    for (; Top != 0;)
    for (; Top != 0;)
    {
    {
-      clog << Top->FullTag() << " \"" << Top->Value << "\";" << endl;
+      str << Top->FullTag() << " \"" << Top->Value << "\";" << endl;
       
       
       if (Top->Child != 0)
       if (Top->Child != 0)
       {
       {

+ 4 - 2
apt-pkg/contrib/configuration.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: configuration.h,v 1.14 2001/05/07 05:06:52 jgg Exp $
+// $Id: configuration.h,v 1.15 2002/11/09 17:11:25 doogie Exp $
 /* ######################################################################
 /* ######################################################################
 
 
    Configuration Class
    Configuration Class
@@ -33,6 +33,7 @@
 #endif 
 #endif 
 
 
 #include <string>
 #include <string>
+#include <iostream>
 
 
 using std::string;
 using std::string;
 
 
@@ -90,7 +91,8 @@ class Configuration
    
    
    inline const Item *Tree(const char *Name) const {return Lookup(Name);};
    inline const Item *Tree(const char *Name) const {return Lookup(Name);};
 
 
-   void Dump();
+   inline void Dump() { Dump(clog); };
+   void Dump(ostream& str);
 
 
    Configuration(const Item *Root);
    Configuration(const Item *Root);
    Configuration();
    Configuration();

+ 2 - 2
cmdline/apt-config.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: apt-config.cc,v 1.9 2002/02/15 03:40:00 jgg Exp $
+// $Id: apt-config.cc,v 1.10 2002/11/09 17:11:25 doogie Exp $
 /* ######################################################################
 /* ######################################################################
    
    
    APT Config - Program to manipulate APT configuration files
    APT Config - Program to manipulate APT configuration files
@@ -57,7 +57,7 @@ bool DoShell(CommandLine &CmdL)
 /* */
 /* */
 bool DoDump(CommandLine &CmdL)
 bool DoDump(CommandLine &CmdL)
 {
 {
-   _config->Dump();
+   _config->Dump(cout);
    return true;
    return true;
 }
 }
 									/*}}}*/
 									/*}}}*/

+ 1 - 0
debian/changelog

@@ -49,6 +49,7 @@ apt (0.5.5) unstable; urgency=low
   * i18n gettext stuff, based on work from Michael Piefel
   * i18n gettext stuff, based on work from Michael Piefel
   * Some highly unlikely memory faults. Closes: #155842
   * Some highly unlikely memory faults. Closes: #155842
   * C++ stuff for G++3.2. Closes: #162617
   * C++ stuff for G++3.2. Closes: #162617
+  * apt-config dumps sends to stdout not stderr now.  Closes: #146294
 
 
  -- Jason Gunthorpe <jgg@debian.org>  Sun, 15 Sep 2002 17:16:59 -0600
  -- Jason Gunthorpe <jgg@debian.org>  Sun, 15 Sep 2002 17:16:59 -0600