|
@@ -413,8 +413,8 @@ bool pkgCdrom::WriteDatabase(Configuration &Cnf)
|
|
|
|
|
|
|
|
Out.close();
|
|
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)
|
|
if (rename(NewFile.c_str(),DFile.c_str()) != 0)
|
|
|
return _error->Errno("rename","Failed to rename %s.new to %s",
|
|
return _error->Errno("rename","Failed to rename %s.new to %s",
|
|
|
DFile.c_str(),DFile.c_str());
|
|
DFile.c_str(),DFile.c_str());
|