summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2013-06-13 15:47:37 +0200
committerMichael Schroeder <mls@suse.de>2013-06-13 15:47:37 +0200
commite891011d5243d123d975b8729734b204f860af56 (patch)
tree2c5f9aec2af6de10d8865784448f484e799e047d
parent0b9f7a96e8e4d50eabf196a725fb74de7f369605 (diff)
downloadlibsolv-e891011d5243d123d975b8729734b204f860af56.tar.gz
libsolv-e891011d5243d123d975b8729734b204f860af56.tar.bz2
libsolv-e891011d5243d123d975b8729734b204f860af56.zip
fix archpolicy handling of '>'
-rw-r--r--doc/Makefile.gen2
-rw-r--r--ext/testcase.c13
-rw-r--r--src/policy.c9
-rw-r--r--src/pool.c1
-rw-r--r--src/pool.h1
-rw-r--r--src/transaction.c4
6 files changed, 23 insertions, 7 deletions
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 <string.h>
#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");
}