~ubuntu-core-dev/apt/ubuntu

« back to all changes in this revision

Viewing changes to apt-pkg/algorithms.cc

* merged the apt-breaks-iwj branch
* pulled in the other remaining ubuntu changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
         DepIterator End;
103
103
         D.GlobOr(Start,End);
104
104
         if (Start->Type == pkgCache::Dep::Conflicts ||
 
105
             Start->Type == pkgCache::Dep::DpkgBreaks ||
105
106
             Start->Type == pkgCache::Dep::Obsoletes ||
106
107
             End->Type == pkgCache::Dep::PreDepends)
107
108
         {
151
152
            cout << " Obsoletes:" << D.TargetPkg().Name();
152
153
         else if (D->Type == pkgCache::Dep::Conflicts)
153
154
            cout << " Conflicts:" << D.TargetPkg().Name();
 
155
         else if (D->Type == pkgCache::Dep::DpkgBreaks)
 
156
            cout << " Breaks:" << D.TargetPkg().Name();
154
157
         else
155
158
            cout << " Depends:" << D.TargetPkg().Name();
156
159
      }     
651
654
               /* We let the algorithm deal with conflicts on its next iteration,
652
655
                it is much smarter than us */
653
656
               if (Start->Type == pkgCache::Dep::Conflicts || 
 
657
                   Start->Type == pkgCache::Dep::DpkgBreaks || 
654
658
                   Start->Type == pkgCache::Dep::Obsoletes)
655
659
                   break;
656
660
               
873
877
            SPtrArray<pkgCache::Version *> VList = Start.AllTargets();
874
878
            if (*VList == 0 && (Flags[I->ID] & Protected) != Protected &&
875
879
                Start->Type != pkgCache::Dep::Conflicts &&
 
880
                Start->Type != pkgCache::Dep::DpkgBreaks &&
876
881
                Start->Type != pkgCache::Dep::Obsoletes &&
877
882
                Cache[I].NowBroken() == false)
878
883
            {          
903
908
               if (Scores[I->ID] <= Scores[Pkg->ID] ||
904
909
                   ((Cache[Start] & pkgDepCache::DepNow) == 0 &&
905
910
                    End->Type != pkgCache::Dep::Conflicts &&
 
911
                    End->Type != pkgCache::Dep::DpkgBreaks &&
906
912
                    End->Type != pkgCache::Dep::Obsoletes))
907
913
               {
908
914
                  // Try a little harder to fix protected packages..
968
974
                      (Start->Type == pkgCache::Dep::Conflicts ||
969
975
                       Start->Type == pkgCache::Dep::Obsoletes))
970
976
                     continue;
971
 
                  
 
977
 
 
978
                  if (Start->Type == pkgCache::Dep::DpkgBreaks)
 
979
                  {
 
980
                     /* Would it help if we upgraded? */
 
981
                     if (Cache[End] & pkgDepCache::DepGCVer) {
 
982
                        if (Debug)
 
983
                           clog << "  Upgrading " << Pkg.Name() << " due to Breaks field in " << I.Name() << endl;
 
984
                        Cache.MarkInstall(Pkg, false, 0, false);
 
985
                        continue;
 
986
                     }
 
987
                     if (Debug)
 
988
                        clog << "  Will not break " << Pkg.Name() << " as stated in Breaks field in " << I.Name() <<endl;
 
989
                     Cache.MarkKeep(I, false, false);
 
990
                     continue;
 
991
                  }
 
992
 
972
993
                  // Skip adding to the kill list if it is protected
973
994
                  if ((Flags[Pkg->ID] & Protected) != 0)
974
995
                     continue;
989
1010
            // Hm, nothing can possibly satisify this dep. Nuke it.
990
1011
            if (VList[0] == 0 && 
991
1012
                Start->Type != pkgCache::Dep::Conflicts &&
 
1013
                Start->Type != pkgCache::Dep::DpkgBreaks &&
992
1014
                Start->Type != pkgCache::Dep::Obsoletes &&
993
1015
                (Flags[I->ID] & Protected) != Protected)
994
1016
            {