summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-worker.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-04-25 17:02:24 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2012-04-25 17:02:24 +0200
commit99b4fefe0f303cf5ae5e8b9116404fc0fcc96e47 (patch)
tree1a3b69e8d10cbf78a7ad278dab0e5b40bf24c69f /apt-pkg/acquire-worker.cc
parent4d74894b85227f42b65a84f459f011d74946e4f4 (diff)
parentcc04f4ce9eaaf0945775d5233806de7da5d21ff6 (diff)
merged from donkult
Diffstat (limited to 'apt-pkg/acquire-worker.cc')
-rw-r--r--apt-pkg/acquire-worker.cc39
1 files changed, 9 insertions, 30 deletions
diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc
index 77e2fc311..8bc043c58 100644
--- a/apt-pkg/acquire-worker.cc
+++ b/apt-pkg/acquire-worker.cc
@@ -467,40 +467,19 @@ bool pkgAcquire::Worker::SendConfiguration()
if (OutFd == -1)
return false;
-
- string Message = "601 Configuration\n";
- Message.reserve(2000);
- /* Write out all of the configuration directives by walking the
+ /* Write out all of the configuration directives by walking the
configuration tree */
- const Configuration::Item *Top = _config->Tree(0);
- for (; Top != 0;)
- {
- if (Top->Value.empty() == false)
- {
- string Line = "Config-Item: " + QuoteString(Top->FullTag(),"=\"\n") + "=";
- Line += QuoteString(Top->Value,"\n") + '\n';
- Message += Line;
- }
-
- if (Top->Child != 0)
- {
- Top = Top->Child;
- continue;
- }
-
- while (Top != 0 && Top->Next == 0)
- Top = Top->Parent;
- if (Top != 0)
- Top = Top->Next;
- }
- Message += '\n';
+ std::ostringstream Message;
+ Message << "601 Configuration\n";
+ _config->Dump(Message, NULL, "Config-Item: %F=%V\n", false);
+ Message << '\n';
if (Debug == true)
- clog << " -> " << Access << ':' << QuoteString(Message,"\n") << endl;
- OutQueue += Message;
- OutReady = true;
-
+ clog << " -> " << Access << ':' << QuoteString(Message.str(),"\n") << endl;
+ OutQueue += Message.str();
+ OutReady = true;
+
return true;
}
/*}}}*/