]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/algorithms.cc
test: remove SHA1 support testing as unsupported
[apt.git] / apt-pkg / algorithms.cc
index d25cbd63aab3ba305a5c9f4af8844c10d3431563..ee4787b3843b97782b5da78a1fca6d4f2211ff79 100644 (file)
@@ -725,6 +725,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
       changing a breaks c) */
    bool Change = true;
    bool const TryFixByInstall = _config->FindB("pkgProblemResolver::FixByInstall", true);
       changing a breaks c) */
    bool Change = true;
    bool const TryFixByInstall = _config->FindB("pkgProblemResolver::FixByInstall", true);
+   std::vector<PackageKill> KillList;
    for (int Counter = 0; Counter != 10 && Change == true; Counter++)
    {
       Change = false;
    for (int Counter = 0; Counter != 10 && Change == true; Counter++)
    {
       Change = false;
@@ -767,12 +768,12 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
            clog << "Investigating (" << Counter << ") " << I << endl;
         
         // Isolate the problem dependency
            clog << "Investigating (" << Counter << ") " << I << endl;
         
         // Isolate the problem dependency
-        PackageKill KillList[100];
-        PackageKill *LEnd = KillList;
         bool InOr = false;
         pkgCache::DepIterator Start;
         pkgCache::DepIterator End;
         bool InOr = false;
         pkgCache::DepIterator Start;
         pkgCache::DepIterator End;
-        PackageKill *OldEnd = LEnd;
+        size_t OldSize = 0;
+
+        KillList.resize(0);
         
         enum {OrRemove,OrKeep} OrOp = OrRemove;
         for (pkgCache::DepIterator D = Cache[I].InstVerIter(Cache).DependsList();
         
         enum {OrRemove,OrKeep} OrOp = OrRemove;
         for (pkgCache::DepIterator D = Cache[I].InstVerIter(Cache).DependsList();
@@ -782,7 +783,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
            if (Start == End)
            {
               // Decide what to do
            if (Start == End)
            {
               // Decide what to do
-              if (InOr == true && OldEnd == LEnd)
+              if (InOr == true && OldSize == KillList.size())
               {
                  if (OrOp == OrRemove)
                  {
               {
                  if (OrOp == OrRemove)
                  {
@@ -816,7 +817,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
                  continue;
 
               InOr = Start != End;
                  continue;
 
               InOr = Start != End;
-              OldEnd = LEnd;
+              OldSize = KillList.size();
            }
            else
             {
            }
            else
             {
@@ -979,10 +980,8 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
                
                  if (Debug == true)
                     clog << "  Added " << Pkg.FullName(false) << " to the remove list" << endl;
                
                  if (Debug == true)
                     clog << "  Added " << Pkg.FullName(false) << " to the remove list" << endl;
-                 
-                 LEnd->Pkg = Pkg;
-                 LEnd->Dep = End;
-                 LEnd++;
+
+                 KillList.push_back({Pkg, End});
                  
                  if (Start.IsNegative() == false)
                     break;
                  
                  if (Start.IsNegative() == false)
                     break;
@@ -1032,7 +1031,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
         // Apply the kill list now
         if (Cache[I].InstallVer != 0)
         {
         // Apply the kill list now
         if (Cache[I].InstallVer != 0)
         {
-           for (PackageKill *J = KillList; J != LEnd; J++)
+           for (auto J = KillList.begin(); J != KillList.end(); J++)
            {
               Change = true;
               if ((Cache[J->Dep] & pkgDepCache::DepGNow) == 0)
            {
               Change = true;
               if ((Cache[J->Dep] & pkgDepCache::DepGNow) == 0)
@@ -1315,7 +1314,7 @@ void pkgProblemResolver::InstallProtect()
 struct PrioComp {
    pkgCache &PrioCache;
 
 struct PrioComp {
    pkgCache &PrioCache;
 
-   PrioComp(pkgCache &PrioCache) : PrioCache(PrioCache) {
+   explicit PrioComp(pkgCache &PrioCache) : PrioCache(PrioCache) {
    }
 
    bool operator() (pkgCache::Version * const &A, pkgCache::Version * const &B) {
    }
 
    bool operator() (pkgCache::Version * const &A, pkgCache::Version * const &B) {