From: Michael Schroeder Date: Thu, 13 Jun 2013 13:47:37 +0000 (+0200) Subject: fix archpolicy handling of '>' X-Git-Tag: upstream/0.6.4~294 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e891011d5243d123d975b8729734b204f860af56;p=platform%2Fupstream%2Flibsolv.git fix archpolicy handling of '>' --- diff --git a/doc/Makefile.gen b/doc/Makefile.gen index d773223..fadc6a2 100644 --- a/doc/Makefile.gen +++ b/doc/Makefile.gen @@ -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 diff --git a/ext/testcase.c b/ext/testcase.c index 1db9051..ceebb8e 100644 --- a/ext/testcase.c +++ b/ext/testcase.c @@ -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]); diff --git a/src/policy.c b/src/policy.c index c3385d8..96d3581 100644 --- a/src/policy.c +++ b/src/policy.c @@ -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) { diff --git a/src/pool.c b/src/pool.c index 06f1e9e..d5a86ec 100644 --- a/src/pool.c +++ b/src/pool.c @@ -19,6 +19,7 @@ #include #include "pool.h" +#include "poolvendor.h" #include "repo.h" #include "poolid.h" #include "poolid_private.h" diff --git a/src/pool.h b/src/pool.h index a3cb364..5527bfa 100644 --- a/src/pool.h +++ b/src/pool.h @@ -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); diff --git a/src/transaction.c b/src/transaction.c index 65c4bc5..ceca1f8 100644 --- a/src/transaction.c +++ b/src/transaction.c @@ -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"); }