~ubuntu-branches/ubuntu/oneiric/apt/oneiric-updates

« back to all changes in this revision

Viewing changes to methods/rred.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt, Julian Andres Klode, Michael Vogt
  • Date: 2010-08-11 12:01:30 UTC
  • Revision ID: james.westby@ubuntu.com-20100811120130-b03fjhapn7b1kc82
Tags: 0.7.26~exp12ubuntu4
[ Julian Andres Klode ]
* apt-pkg/contrib/fileutl.cc:
  - Add WriteAtomic mode.
  - Revert WriteEmpty to old behavior (LP: #613211)
* apt-pkg, methods:
  - Convert users of WriteEmpty to WriteAtomic.
* apt-pkg/depcache.cc:
  - Only try upgrade for Breaks if there is a newer version, otherwise
    handle it as Conflicts (by removing it) (helps for #591882).

[ Michael Vogt ]
* debian/control:
  - Add recommends on gnupg to apt, apt-key uses it.
    (changed from debian)

Show diffs side-by-side

added added

removed removed

Lines of Context:
446
446
   // the cleanup/closing of the fds)
447
447
   FileFd From(Path,FileFd::ReadOnly);
448
448
   FileFd Patch(Path+".ed",FileFd::ReadOnly);
449
 
   FileFd To(Itm->DestFile,FileFd::WriteEmpty);   
 
449
   FileFd To(Itm->DestFile,FileFd::WriteAtomic);   
450
450
   To.EraseOnFailure();
451
451
   if (_error->PendingError() == true)
452
452
      return false;
458
458
      // retry with patchFile
459
459
      lseek(Patch.Fd(), 0, SEEK_SET);
460
460
      lseek(From.Fd(), 0, SEEK_SET);
461
 
      To.Open(Itm->DestFile,FileFd::WriteEmpty);
 
461
      To.Open(Itm->DestFile,FileFd::WriteAtomic);
462
462
      if (_error->PendingError() == true)
463
463
         return false;
464
464
      if (patchFile(Patch, From, To, &Hash) != ED_OK) {