~ubuntu-core-dev/apt/oneiric

« back to all changes in this revision

Viewing changes to apt-pkg/depcache.cc

  • Committer: Michael Vogt
  • Date: 2011-08-15 12:14:35 UTC
  • mfrom: (1327.97.57 debian-sid)
  • Revision ID: michael.vogt@ubuntu.com-20110815121435-ya00o0nicb1kiz2y
merged from the debian-sid branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
129
129
   /* Set the current state of everything. In this state all of the
130
130
      packages are kept exactly as is. See AllUpgrade */
131
131
   int Done = 0;
132
 
   for (PkgIterator I = PkgBegin(); I.end() != true; I++,Done++)
 
132
   for (PkgIterator I = PkgBegin(); I.end() != true; ++I, ++Done)
133
133
   {
134
134
      if (Prog != 0 && Done%20 == 0)
135
135
         Prog->Progress(Done);
292
292
   
293
293
   // then write the ones we have not seen yet
294
294
   std::ostringstream ostr;
295
 
   for(pkgCache::PkgIterator pkg=Cache->PkgBegin(); !pkg.end(); pkg++) {
 
295
   for(pkgCache::PkgIterator pkg=Cache->PkgBegin(); !pkg.end(); ++pkg) {
296
296
      StateCache const &P = PkgState[pkg->ID];
297
297
      if(P.Flags & Flag::Auto) {
298
298
         if (pkgs_seen.find(pkg.FullName()) != pkgs_seen.end()) {
365
365
   // Check the providing packages
366
366
   PrvIterator P = Dep.TargetPkg().ProvidesList();
367
367
   PkgIterator Pkg = Dep.ParentPkg();
368
 
   for (; P.end() != true; P++)
 
368
   for (; P.end() != true; ++P)
369
369
   {
370
370
      /* Provides may never be applied against the same package (or group)
371
371
         if it is a conflicts. See the comment above. */
534
534
{
535
535
   unsigned char Group = 0;
536
536
   
537
 
   for (DepIterator D = V.DependsList(); D.end() != true; D++)
 
537
   for (DepIterator D = V.DependsList(); D.end() != true; ++D)
538
538
   {
539
539
      // Build the dependency state.
540
540
      unsigned char &State = DepState[D->ID];
574
574
      // Compute a single dependency element (glob or)
575
575
      DepIterator Start = D;
576
576
      unsigned char State = 0;
577
 
      for (bool LastOR = true; D.end() == false && LastOR == true; D++)
 
577
      for (bool LastOR = true; D.end() == false && LastOR == true; ++D)
578
578
      {
579
579
         State |= DepState[D->ID];
580
580
         LastOR = (D->CompareOp & Dep::Or) == Dep::Or;
664
664
 
665
665
   // Perform the depends pass
666
666
   int Done = 0;
667
 
   for (PkgIterator I = PkgBegin(); I.end() != true; I++,Done++)
 
667
   for (PkgIterator I = PkgBegin(); I.end() != true; ++I, ++Done)
668
668
   {
669
669
      if (Prog != 0 && Done%20 == 0)
670
670
         Prog->Progress(Done);
671
 
      for (VerIterator V = I.VersionList(); V.end() != true; V++)
 
671
      for (VerIterator V = I.VersionList(); V.end() != true; ++V)
672
672
      {
673
673
         unsigned char Group = 0;
674
674
 
675
 
         for (DepIterator D = V.DependsList(); D.end() != true; D++)
 
675
         for (DepIterator D = V.DependsList(); D.end() != true; ++D)
676
676
         {
677
677
            // Build the dependency state.
678
678
            unsigned char &State = DepState[D->ID];
709
709
void pkgDepCache::Update(DepIterator D)
710
710
{
711
711
   // Update the reverse deps
712
 
   for (;D.end() != true; D++)
 
712
   for (;D.end() != true; ++D)
713
713
   {      
714
714
      unsigned char &State = DepState[D->ID];
715
715
      State = DependencyState(D);
742
742
   // Update the provides map for the current ver
743
743
   if (Pkg->CurrentVer != 0)
744
744
      for (PrvIterator P = Pkg.CurrentVer().ProvidesList(); 
745
 
           P.end() != true; P++)
 
745
           P.end() != true; ++P)
746
746
         Update(P.ParentPkg().RevDependsList());
747
747
 
748
748
   // Update the provides map for the candidate ver
749
749
   if (PkgState[Pkg->ID].CandidateVer != 0)
750
750
      for (PrvIterator P = PkgState[Pkg->ID].CandidateVerIter(*this).ProvidesList();
751
 
           P.end() != true; P++)
 
751
           P.end() != true; ++P)
752
752
         Update(P.ParentPkg().RevDependsList());
753
753
}
754
754
                                                                        /*}}}*/
1010
1010
      DepIterator Start = Dep;
1011
1011
      bool Result = true;
1012
1012
      unsigned Ors = 0;
1013
 
      for (bool LastOR = true; Dep.end() == false && LastOR == true; Dep++,Ors++)
 
1013
      for (bool LastOR = true; Dep.end() == false && LastOR == true; ++Dep, ++Ors)
1014
1014
      {
1015
1015
         LastOR = (Dep->CompareOp & Dep::Or) == Dep::Or;
1016
1016
 
1476
1476
      unless they are already installed */
1477
1477
   VerIterator Last(*(pkgCache *)this,0);
1478
1478
   
1479
 
   for (VerIterator I = Pkg.VersionList(); I.end() == false; I++)
 
1479
   for (VerIterator I = Pkg.VersionList(); I.end() == false; ++I)
1480
1480
   {
1481
1481
      if (Pkg.CurrentVer() == I)
1482
1482
         return I;
1483
1483
      
1484
 
      for (VerFileIterator J = I.FileList(); J.end() == false; J++)
 
1484
      for (VerFileIterator J = I.FileList(); J.end() == false; ++J)
1485
1485
      {
1486
1486
         if ((J.File()->Flags & Flag::NotSource) != 0)
1487
1487
            continue;