fix archpolicy handling of '>'
authorMichael Schroeder <mls@suse.de>
Thu, 13 Jun 2013 13:47:37 +0000 (15:47 +0200)
committerMichael Schroeder <mls@suse.de>
Thu, 13 Jun 2013 13:47:37 +0000 (15:47 +0200)
doc/Makefile.gen
ext/testcase.c
src/policy.c
src/pool.c
src/pool.h
src/transaction.c

index d773223..fadc6a2 100644 (file)
@@ -1,5 +1,5 @@
 
-man: libsolv.3 libsolv-bindings.3 libsolv-constantids.3 libsolv-history.3
+man: libsolv.3 libsolv-bindings.3 libsolv-constantids.3 libsolv-history.3 libsolv-pool.3
 
 html: libsolv.html libsolv-bindings.html libsolv-constantids.html libsolv-history.html
 
index 1db9051..ceebb8e 100644 (file)
@@ -332,6 +332,11 @@ testcase_str2dep(Pool *pool, char *s)
   while (*s == ' ' || *s == '\t')
     s++;
   flags = 0;
+  if (*s == '!' && s[1] == '=')        /* support != as synonym for <> */
+    {
+      flags = REL_LT | REL_GT;
+      s += 2;
+    }
   for (;;s++)
     {  
       if (*s == '<')
@@ -2009,10 +2014,12 @@ testcase_read(Pool *pool, FILE *fp, char *testcase, Queue *job, char **resultp,
              pool_debug(pool, SOLV_ERROR, "testcase_read: system: cannot change disttype to '%s'\n", pieces[2]);
 #endif
            }
-         if (strcmp(pieces[1], "unset") != 0)
-           pool_setarch(pool, pieces[1]);
-         else
+         if (strcmp(pieces[1], "unset") == 0)
            pool_setarch(pool, 0);
+         else if (pieces[1][0] == ':')
+           pool_setarchpolicy(pool, pieces[1] + 1);
+         else
+           pool_setarch(pool, pieces[1]);
          if (npieces > 3)
            {
              Repo *repo = testcase_str2repo(pool, pieces[3]);
index c3385d8..96d3581 100644 (file)
@@ -51,6 +51,15 @@ prune_to_best_version_sortcmp(const void *ap, const void *bp, void *dp)
       nb = pool_id2str(pool, sb->name);
       return strcmp(na, nb);
     }
+  if (sa->arch != sb->arch)
+    {
+      int aa, ab;
+      aa = (sa->arch <= pool->lastarch) ? pool->id2arch[sa->arch] : 0;
+      ab = (sb->arch <= pool->lastarch) ? pool->id2arch[sb->arch] : 0;
+      if (aa != ab && aa > 1 && ab > 1)
+       return aa - ab;         /* lowest score first */
+    }
+
   /* the same name, bring installed solvables to the front */
   if (pool->installed)
     {
index 06f1e9e..d5a86ec 100644 (file)
@@ -19,6 +19,7 @@
 #include <string.h>
 
 #include "pool.h"
+#include "poolvendor.h"
 #include "repo.h"
 #include "poolid.h"
 #include "poolid_private.h"
index a3cb364..5527bfa 100644 (file)
@@ -228,7 +228,6 @@ extern void pool_setdisttype(Pool *pool, int disttype);
 #endif
 extern int  pool_set_flag(Pool *pool, int flag, int value);
 extern int  pool_get_flag(Pool *pool, int flag);
-extern void pool_setvendorclasses(Pool *pool, const char **vendorclasses);
 
 extern void pool_debug(Pool *pool, int type, const char *format, ...) __attribute__((format(printf, 3, 4)));
 extern void pool_setdebugcallback(Pool *pool, void (*debugcallback)(struct _Pool *, void *data, int type, const char *str), void *debugcallbackdata);
index 65c4bc5..ceca1f8 100644 (file)
@@ -2087,7 +2087,7 @@ transaction_check_order(Transaction *trans)
   Map ins, seen;
   int i;
 
-  POOL_DEBUG(SOLV_WARN, "\nchecking transaction order...\n");
+  POOL_DEBUG(SOLV_DEBUG_RESULT, "\nchecking transaction order...\n");
   map_init(&ins, pool->nsolvables);
   map_init(&seen, pool->nsolvables);
   if (pool->installed)
@@ -2112,5 +2112,5 @@ transaction_check_order(Transaction *trans)
     }
   map_free(&seen);
   map_free(&ins);
-  POOL_DEBUG(SOLV_WARN, "transaction order check done.\n");
+  POOL_DEBUG(SOLV_DEBUG_RESULT, "transaction order check done.\n");
 }