View | Details | Raw Unified | Return to bug 54684
Collapse All | Expand All

(-)a/apt-pkg/algorithms.cc (-3 / +33 lines)
Lines 1498-1504 bool pkgProblemResolver::Resolve(bool BrokenFix) Link Here
1498
1498
1499
	 // Isolate the problem dependency
1499
	 // Isolate the problem dependency
1500
	 PackageKill KillList[100];
1500
	 PackageKill KillList[100];
1501
	 PackageKill KillListTemp[100];
1501
	 PackageKill *LEnd = KillList;
1502
	 PackageKill *LEnd = KillList;
1503
	 PackageKill *LEndTemp = KillListTemp;
1502
	 bool InOr = false;
1504
	 bool InOr = false;
1503
	 pkgCache::DepIterator Start;
1505
	 pkgCache::DepIterator Start;
1504
	 pkgCache::DepIterator End;
1506
	 pkgCache::DepIterator End;
Lines 1580-1585 bool pkgProblemResolver::Resolve(bool BrokenFix) Link Here
1580
	       break;
1582
	       break;
1581
	    }
1583
	    }
1582
1584
1585
            auto flushTemp = [&]()
1586
            {
1587
                for (PackageKill *ptrTemp = KillListTemp; ptrTemp != LEndTemp; ++ptrTemp)
1588
                {
1589
                    *LEnd = *ptrTemp;
1590
                    ++LEnd;
1591
                }
1592
                LEndTemp = KillListTemp;
1593
            };
1594
1583
	    bool Done = false;
1595
	    bool Done = false;
1584
	    for (pkgCache::Version * const *V = VList.get(); *V != nullptr; V++)
1596
	    for (pkgCache::Version * const *V = VList.get(); *V != nullptr; V++)
1585
	    {
1597
	    {
Lines 1608-1613 bool pkgProblemResolver::Resolve(bool BrokenFix) Link Here
1608
			break;
1620
			break;
1609
		     }
1621
		     }
1610
1622
1623
                     if (*(V + 1) == nullptr && LEndTemp != KillListTemp)
1624
                        flushTemp();
1625
1611
		     continue;
1626
		     continue;
1612
		  }
1627
		  }
1613
1628
Lines 1670-1680 bool pkgProblemResolver::Resolve(bool BrokenFix) Link Here
1670
		  if (Cache[Pkg].InstallVer != Ver.operator const pkgCache::Version *() &&
1685
		  if (Cache[Pkg].InstallVer != Ver.operator const pkgCache::Version *() &&
1671
		      (Start->Type == pkgCache::Dep::Conflicts ||
1686
		      (Start->Type == pkgCache::Dep::Conflicts ||
1672
		       Start->Type == pkgCache::Dep::Obsoletes))
1687
		       Start->Type == pkgCache::Dep::Obsoletes))
1673
		     continue;
1688
		  {
1689
                     if (*(V + 1) == nullptr && LEndTemp != KillListTemp)
1690
                        flushTemp();
1691
1692
                     continue;
1693
		  }
1674
1694
1675
		  // Skip adding to the kill list if it is protected
1695
		  // Skip adding to the kill list if it is protected
1676
		  if ((Flags[Pkg->ID] & Protected) != 0)
1696
		  if ((Flags[Pkg->ID] & Protected) != 0)
1677
		     continue;
1697
                  {
1698
                     if (*(V + 1) == nullptr && LEndTemp != KillListTemp)
1699
                        flushTemp();
1700
1701
                     continue;
1702
                  }
1678
1703
1679
		  // CNC:2003-03-22
1704
		  // CNC:2003-03-22
1680
		  pkgDepCache::State State(&Cache);
1705
		  pkgDepCache::State State(&Cache);
Lines 1693-1698 bool pkgProblemResolver::Resolve(bool BrokenFix) Link Here
1693
1718
1694
		  DBG.traceSolver(2, std::string("Added ") + ToDbgStr(Pkg) + " to the remove list");
1719
		  DBG.traceSolver(2, std::string("Added ") + ToDbgStr(Pkg) + " to the remove list");
1695
1720
1721
                  // Add this (Pkg, Dep) pair to the temporary kill list;
1722
                  // it will be applied if no other solution is found
1723
                  LEndTemp->Pkg = Pkg;
1724
                  LEndTemp->Dep = End;
1725
                  LEndTemp++;
1726
1696
		  // CNC:2002-07-09
1727
		  // CNC:2002-07-09
1697
		  if (*(V+1) != 0) //XXX Look for other solutions?
1728
		  if (*(V+1) != 0) //XXX Look for other solutions?
1698
		      continue;
1729
		      continue;
1699
- 

Return to bug 54684