Просмотр исходного кода

* apt-pkg/cdrom.cc:
- Use link() instead of rename() for creating the CD database backup;
otherwise there would be a short time without any database.

Julian Andres Klode лет назад: 16
Родитель
Сommit
15032eec2d
2 измененных файлов с 4 добавлено и 1 удалено
  1. 1 1
      apt-pkg/cdrom.cc
  2. 3 0
      debian/changelog

+ 1 - 1
apt-pkg/cdrom.cc

@@ -383,7 +383,7 @@ bool pkgCdrom::WriteDatabase(Configuration &Cnf)
 
    Out.close();
    
-   rename(DFile.c_str(),string(DFile + '~').c_str());
+   link(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());

+ 3 - 0
debian/changelog

@@ -8,6 +8,9 @@ apt (0.7.26~exp11) experimental; urgency=low
   * cmdline/apt-get.cc:
     - Support large filesystems by using statvfs64() instead of statvfs()
       and statfs64() instead of statfs() (Closes: #590513).
+  * apt-pkg/cdrom.cc:
+    - Use link() instead of rename() for creating the CD database backup;
+      otherwise there would be a short time without any database.
 
  -- Julian Andres Klode <jak@debian.org>  Wed, 21 Jul 2010 17:09:11 +0200