diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2012-08-05 14:16:24 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2012-08-05 14:16:24 +0200 |
commit | c1cd1ac2fd051a11ec5c3eafad68b39521594ed6 (patch) | |
tree | cc558b95cfc5f0439f5142df99baeae0944676af /apt-pkg/cdrom.cc | |
parent | d5da93b83f886b87958e52d4658b9f08b255b36c (diff) |
* 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)
Diffstat (limited to 'apt-pkg/cdrom.cc')
-rw-r--r-- | apt-pkg/cdrom.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index 8462e8286..699f66fb3 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -413,8 +413,8 @@ bool pkgCdrom::WriteDatabase(Configuration &Cnf) 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()); |