* apt-pkg/cdrom.cc:
[ntk/apt.git] / apt-pkg / cdrom.cc
index c10ca6b..699f66f 100644 (file)
@@ -409,12 +409,12 @@ bool pkgCdrom::WriteDatabase(Configuration &Cnf)
    
    /* Write out all of the configuration directives by walking the
       configuration tree */
-   _config->Dump(Out, NULL, "%f \"%v\";\n", false);
+   Cnf.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 (FileExists(DFile) == true)
+      rename(DFile.c_str(), string(DFile + '~').c_str());
    if (rename(NewFile.c_str(),DFile.c_str()) != 0)
       return _error->Errno("rename","Failed to rename %s.new to %s",
                           DFile.c_str(),DFile.c_str());