]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Some little tweaks
authorMichael Schroeder <mls@suse.de>
Fri, 3 Nov 2017 11:01:34 +0000 (12:01 +0100)
committerMichael Schroeder <mls@suse.de>
Fri, 3 Nov 2017 11:01:34 +0000 (12:01 +0100)
src/problems.c
src/solver.c

index 29d51705e8e5342231fabfb29470237f031513cf..9d17d284e0c7e79a629d7139cac27b6456cd212f 100644 (file)
@@ -66,7 +66,7 @@ solver_disableproblem(Solver *solv, Id v)
   jp = solv->ruletojob.elements;
   if (solv->bestrules_pkg)
     {
-      int ni = solv->bestrules_end - solv->bestrules;
+      int ni = solv->bestrules_up - solv->bestrules;
       for (i = 0; i < ni; i++)
        {
          int j = solv->bestrules_pkg[i];
@@ -133,7 +133,7 @@ solver_enableproblem(Solver *solv, Id v)
   jp = solv->ruletojob.elements;
   if (solv->bestrules_pkg)
     {
-      int ni = solv->bestrules_end - solv->bestrules;
+      int ni = solv->bestrules_up - solv->bestrules;
       for (i = 0; i < ni; i++)
        {
          int j = solv->bestrules_pkg[i];
index 42aec8251557b497737af0122403a6d6757d57dc..a46c3cfe3ce46df5917946cffb5dac2b3b1af8b1 100644 (file)
@@ -194,9 +194,6 @@ makeruledecisions(Solver *solv, int disablerules)
            if (solv->decisionq.elements[i] == -v)
              break;
          assert(i < solv->decisionq.count);         /* assert that we found it */
-         oldproblemcount = solv->problems.count;
-         queue_push(&solv->problems, 0);
-
          if (v == -SYSTEMSOLVABLE)
            ori = 0;
          else
@@ -206,11 +203,14 @@ makeruledecisions(Solver *solv, int disablerules)
            }
 
          /*
-          * conflict with system solvable or pkg rule?
-          */
+           * record the problem
+           */
          doautouninstall = 0;
+         oldproblemcount = solv->problems.count;
+         queue_push(&solv->problems, 0);                       /* start problem */
          if (ori < solv->pkgrules_end)
            {
+             /* easy: conflict with system solvable or pkg rule */
              assert(v > 0 || v == -SYSTEMSOLVABLE);
              IF_POOLDEBUG (SOLV_DEBUG_UNSOLVABLE)
                {
@@ -251,8 +251,9 @@ makeruledecisions(Solver *solv, int disablerules)
                    doautouninstall = 1;
                }
            }
-         queue_push(&solv->problems, 0);
+         queue_push(&solv->problems, 0);                       /* finish problem */
 
+         /* try autouninstall if requested */
          if (doautouninstall)
            {
              if (solv->allowuninstall || solv->allowuninstall_all || solv->allowuninstallmap.size)
@@ -333,7 +334,7 @@ makeruledecisions(Solver *solv, int disablerules)
       if (ii == solv->ruleassertions.count)
        break;  /* finished! */
     }
-  return 1;
+  return 1;            /* the new level */
 }