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

« back to all changes in this revision

Viewing changes to apt-pkg/contrib/fileutl.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:
669
669
      }
670
670
      break;
671
671
      
672
 
      case WriteEmpty:
 
672
      case WriteAtomic:
673
673
      {
674
674
         Flags |= Replace;
675
675
         char *name = strdup((FileName + ".XXXXXX").c_str());
678
678
         free(name);
679
679
         break;
680
680
      }
 
681
 
 
682
      case WriteEmpty:
 
683
      {
 
684
         struct stat Buf;
 
685
         if (lstat(FileName.c_str(),&Buf) == 0 && S_ISLNK(Buf.st_mode))
 
686
            unlink(FileName.c_str());
 
687
         iFd = open(FileName.c_str(),O_RDWR | O_CREAT | O_TRUNC,Perms);
 
688
         break;
 
689
      }
681
690
      
682
691
      case WriteExists:
683
692
      iFd = open(FileName.c_str(),O_RDWR);