~ubuntu-branches/ubuntu/natty/apt/natty

« back to all changes in this revision

Viewing changes to apt-pkg/pkgcachegen.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2011-04-05 13:19:56 UTC
  • Revision ID: james.westby@ubuntu.com-20110405131956-u6sgfjr30zvy2fr3
Tags: 0.8.13.2ubuntu1
* merge fixes from debian-sid, most notable the handling of
  arch=all architectures in python-apt (LP: #733741)
* apt-pkg/aptconfiguration.cc:
  - fix comparing for a empty string

Show diffs side-by-side

added added

removed removed

Lines of Context:
178
178
      if (PackageName.empty() == true)
179
179
         return false;
180
180
 
181
 
      /* Treat Arch all packages as the same as the native arch. */
182
 
      string Arch;
183
 
      if (List.ArchitectureAll() == true)
184
 
         Arch = _config->Find("APT::Architecture");
185
 
      else
186
 
         Arch = List.Architecture();
 
181
      string const Arch = List.Architecture();
187
182
 
188
183
      // Get a pointer to the package structure
189
184
      pkgCache::PkgIterator Pkg;
484
479
   // Set the name, arch and the ID
485
480
   Pkg->Name = Grp->Name;
486
481
   Pkg->Group = Grp.Index();
487
 
   map_ptrloc const idxArch = WriteUniqString(Arch.c_str());
 
482
   map_ptrloc const idxArch = WriteUniqString((Arch == "all") ? _config->Find("APT::Architecture") : Arch.c_str());
488
483
   if (unlikely(idxArch == 0))
489
484
      return false;
490
485
   Pkg->Arch = idxArch;
643
638
                - MultiArch: same → Co-Installable if they have the same version
644
639
                - Architecture: all → Need to be Co-Installable for internal reasons
645
640
                - All others conflict with all other group members */
646
 
               bool const coInstall = (V->MultiArch == pkgCache::Version::Same);
 
641
               bool const coInstall = ((V->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same);
647
642
               for (vector<string>::const_iterator A = archs.begin(); A != archs.end(); ++A)
648
643
               {
649
644
                  if (*A == Arch)
787
782
   pkgCache &Cache = Owner->Cache;
788
783
 
789
784
   // We do not add self referencing provides
790
 
   if (Ver.ParentPkg().Name() == PkgName && PkgArch == Ver.Arch())
 
785
   if (Ver.ParentPkg().Name() == PkgName && (PkgArch == Ver.ParentPkg().Arch() ||
 
786
        (PkgArch == "all" && _config->Find("APT::Architecture") == Ver.ParentPkg().Arch())))
791
787
      return true;
792
788
   
793
789
   // Get a structure