fix selection_limit_rel call for debian nevra match
authorMichael Schroeder <mls@suse.de>
Mon, 29 Oct 2012 10:49:09 +0000 (11:49 +0100)
committerMichael Schroeder <mls@suse.de>
Mon, 29 Oct 2012 10:49:09 +0000 (11:49 +0100)
bindings/solv.i
src/selection.c

index 12df2426c8cd0877cca0647d56c1dc3b0a14e292..021ca6f20dc93e735b01ad2a8b03c51ba80db1c3 100644 (file)
@@ -784,9 +784,8 @@ typedef struct {
   %rename("str") __str__;
 #endif
   const char *__str__() {
-    char *s;
     int i;
-    s = pool_tmpjoin($self->pool, 0, 0, 0);
+    char *s = pool_tmpjoin($self->pool, 0, 0, 0);
     for (i = 0; i < $self->q.count; i += 2)
       s = pool_tmpappend($self->pool, s, " | ", solver_select2str($self->pool, $self->q.elements[i] & SOLVER_SELECTMASK, $self->q.elements[i + 1]));
     return *s ? s + 3 : s;
index 2f5ca91714b9c7f84eee096db5141569adb148e3..b1ebdaa9980fad284dc440247cb2479e4a009868 100644 (file)
@@ -151,7 +151,7 @@ selection_flatten(Pool *pool, Queue *selection)
 }
 
 static void
-selection_limit_rel(Pool *pool, Queue *selection, Id flags, Id evr)
+selection_limit_rel(Pool *pool, Queue *selection, Id relflags, Id relevr)
 {
   int i, j;
   for (i = j = 0; i < selection->count; i += 2)
@@ -159,15 +159,15 @@ selection_limit_rel(Pool *pool, Queue *selection, Id flags, Id evr)
       Id select = selection->elements[i] & SOLVER_SELECTMASK;
       if (select != SOLVER_SOLVABLE_NAME && select != SOLVER_SOLVABLE_PROVIDES)
        continue;       /* actually internal error */
-      selection->elements[i + 1] = pool_rel2id(pool, selection->elements[i + 1], evr, flags, 1);
-      if (flags == REL_ARCH)
+      selection->elements[i + 1] = pool_rel2id(pool, selection->elements[i + 1], relevr, relflags, 1);
+      if (relflags == REL_ARCH)
         selection->elements[i] |= SOLVER_SETARCH;
-      if (flags == REL_EQ && select == SOLVER_SOLVABLE_NAME && selection->elements[i])
+      if (relflags == REL_EQ && select == SOLVER_SOLVABLE_NAME && selection->elements[i])
         {
          if (pool->disttype == DISTTYPE_DEB)
             selection->elements[i] |= SOLVER_SETEVR;   /* debian can't match version only like rpm */
          else
-           selection->elements[i] |= strchr(pool_id2str(pool, evr), '-') != 0 ? SOLVER_SETEVR : SOLVER_SETEV;
+           selection->elements[i] |= strchr(pool_id2str(pool, relevr), '-') != 0 ? SOLVER_SETEVR : SOLVER_SETEV;
         }
     }
   selection_prune(pool, selection);
@@ -421,7 +421,7 @@ selection_nevra(Pool *pool, Queue *selection, const char *name, int flags)
          *r2 = 0;      /* split off */
           selection_limit_rel(pool, selection, REL_ARCH, archid);
        }
-      selection_limit_rel(pool, selection, flags, pool_str2id(pool, r, 1));
+      selection_limit_rel(pool, selection, REL_EQ, pool_str2id(pool, r, 1));
       solv_free(rname);
       return ret;
     }