From 849e64ac558c5c72a65b6ee0098fdfc538eca5e6 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 22 Apr 2012 13:01:37 +0200 Subject: * apt-pkg/cdrom.cc: - use Dump() to generate the configuration output --- apt-pkg/cdrom.cc | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'apt-pkg/cdrom.cc') diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index 50c204371..c10ca6bd1 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -409,27 +409,10 @@ bool pkgCdrom::WriteDatabase(Configuration &Cnf) /* Write out all of the configuration directives by walking the configuration tree */ - const Configuration::Item *Top = Cnf.Tree(0); - for (; Top != 0;) - { - // Print the config entry - if (Top->Value.empty() == false) - Out << Top->FullTag() + " \"" << Top->Value << "\";" << endl; - - if (Top->Child != 0) - { - Top = Top->Child; - continue; - } - - while (Top != 0 && Top->Next == 0) - Top = Top->Parent; - if (Top != 0) - Top = Top->Next; - } + _config->Dump(Out, NULL, "%f \"%v\";\n", false); Out.close(); - + if (FileExists(DFile) == true && link(DFile.c_str(),string(DFile + '~').c_str()) != 0) return _error->Errno("link", "Failed to link %s to %s~", DFile.c_str(), DFile.c_str()); if (rename(NewFile.c_str(),DFile.c_str()) != 0) -- cgit v1.2.3