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());
* apt-pkg/indexcopy.cc:
- do not use atomic writing if the target is /dev/null as we don't want
to replace it, not even automically. (Closes: #683410)
+ * apt-pkg/cdrom.cc:
+ - do not link() but rename() the cdroms.list to cdroms.list~ as a backup
+ to ensure that apt-cdrom can be run multiple times (Closes: #676302)
-- David Kalnischkies <kalnischkies@gmail.com> Wed, 18 Jul 2012 11:45:57 +0200