]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Do not disable infarch rules when they don't conflict with the job
authorMichael Schroeder <mls@suse.de>
Tue, 15 Jan 2019 13:06:08 +0000 (14:06 +0100)
committerMichael Schroeder <mls@suse.de>
Tue, 15 Jan 2019 13:06:08 +0000 (14:06 +0100)
Otherwise installing a package with the best arch might allow to
pull in the inferior arch as well.

src/rules.c

index 2087b35c7bccbd0ec1ffb4c336db543d6195bb76..175cb8d976e47a58a0a3ff19a67893222dbc4bb9 100644 (file)
@@ -2126,7 +2126,13 @@ jobtodisablelist(Solver *solv, Id how, Id what, Queue *q)
       if ((set & SOLVER_SETARCH) != 0 && solv->infarchrules != solv->infarchrules_end)
        {
          if (select == SOLVER_SOLVABLE)
-           queue_push2(q, DISABLE_INFARCH, pool->solvables[what].name);
+           {
+             for (i = solv->infarchrules; i < solv->infarchrules_end; i++)
+               if (solv->rules[i].p == -what)
+                 break;
+             if (i < solv->infarchrules_end)
+               queue_push2(q, DISABLE_INFARCH, pool->solvables[what].name);
+           }
          else
            {
              int qcnt = q->count;
@@ -2140,8 +2146,12 @@ jobtodisablelist(Solver *solv, Id how, Id what, Queue *q)
                    if (q->elements[i + 1] == s->name)
                      break;
                  if (i < q->count)
-                   continue;
-                 queue_push2(q, DISABLE_INFARCH, s->name);
+                   continue;           /* already have that DISABLE_INFARCH element */
+                 for (i = solv->infarchrules; i < solv->infarchrules_end; i++)
+                   if (solv->rules[i].p == -p)
+                     break;
+                 if (i < solv->infarchrules_end)
+                   queue_push2(q, DISABLE_INFARCH, s->name);
                }
            }
        }