From: Michael Schroeder Date: Wed, 30 Jan 2008 14:56:38 +0000 (+0000) Subject: - use namespace instead of solvable for languages X-Git-Tag: BASE-SuSE-Code-12_1-Branch~308^2~679 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b3768b460562f0628d4e98d9401435c6b211e59;p=thirdparty%2Flibsolv.git - use namespace instead of solvable for languages (breaks some test cases, solv files have to be regenerated) --- diff --git a/src/pool.c b/src/pool.c index 192e71c9..f4524ac4 100644 --- a/src/pool.c +++ b/src/pool.c @@ -55,6 +55,7 @@ static const char *initpool_data[] = { "namespace:installed", "namespace:modalias", "namespace:splitprovides", + "namespace:language", "system:system", "src", "nosrc", diff --git a/src/pool.h b/src/pool.h index c2969fe9..7b6a11af 100644 --- a/src/pool.h +++ b/src/pool.h @@ -47,15 +47,16 @@ extern "C" { #define NAMESPACE_INSTALLED 18 #define NAMESPACE_MODALIAS 19 #define NAMESPACE_SPLITPROVIDES 20 -#define SYSTEM_SYSTEM 21 -#define ARCH_SRC 22 -#define ARCH_NOSRC 23 -#define ARCH_NOARCH 24 -#define REPODATA_EXTERNAL 25 -#define REPODATA_KEYS 26 -#define REPODATA_LOCATION 27 - -#define ID_NUM_INTERNAL 28 +#define NAMESPACE_LANGUAGE 21 +#define SYSTEM_SYSTEM 22 +#define ARCH_SRC 23 +#define ARCH_NOSRC 24 +#define ARCH_NOARCH 25 +#define REPODATA_EXTERNAL 26 +#define REPODATA_KEYS 27 +#define REPODATA_LOCATION 28 + +#define ID_NUM_INTERNAL 29 /* well known solvable */ diff --git a/src/repo.c b/src/repo.c index 845a494b..fd6abe39 100644 --- a/src/repo.c +++ b/src/repo.c @@ -346,9 +346,14 @@ repo_fix_legacy(Repo *repo, Offset provides, Offset supplements) dep = p + 1; continue; } - strncpy(dep - 9, "language:", 9); *p++ = 0; +#if 0 + strncpy(dep - 9, "language:", 9); idl = str2id(pool, dep - 9, 1); +#else + idl = str2id(pool, dep, 1); + idl = rel2id(pool, NAMESPACE_LANGUAGE, idl, REL_NAMESPACE, 1); +#endif if (id) id = rel2id(pool, id, idl, REL_OR, 1); else @@ -360,8 +365,13 @@ repo_fix_legacy(Repo *repo, Offset provides, Offset supplements) for (p = dep; *p && *p != ')'; p++) ; *p = 0; +#if 0 strncpy(dep - 9, "language:", 9); idl = str2id(pool, dep - 9, 1); +#else + idl = str2id(pool, dep, 1); + idl = rel2id(pool, NAMESPACE_LANGUAGE, idl, REL_NAMESPACE, 1); +#endif if (id) id = rel2id(pool, id, idl, REL_OR, 1); else diff --git a/src/solver.c b/src/solver.c index 334ebdfe..7ad82d76 100644 --- a/src/solver.c +++ b/src/solver.c @@ -2328,9 +2328,9 @@ run_solver(Solver *solv, int disablerules, int doweak) int qcount; POOL_DEBUG(SAT_DEBUG_STATS, "installing recommended packages\n"); - if (!REGARD_RECOMMENDS_OF_INSTALLED_ITEMS) + if (!solv->dosplitprovides && !REGARD_RECOMMENDS_OF_INSTALLED_ITEMS) { - for (i = 0; i < solv->decisionq.count; i++) + for (i = 1; i < solv->decisionq.count; i++) { p = solv->decisionq.elements[i]; if (p > 0 && pool->solvables[p].repo == solv->installed) @@ -2380,9 +2380,9 @@ run_solver(Solver *solv, int disablerules, int doweak) queue_pushunique(&dq, i); } } - if (!REGARD_RECOMMENDS_OF_INSTALLED_ITEMS) + if (!solv->dosplitprovides && !REGARD_RECOMMENDS_OF_INSTALLED_ITEMS) { - for (i = 0; i < solv->decisionq.count; i++) + for (i = 1; i < solv->decisionq.count; i++) { p = solv->decisionq.elements[i]; if (p > 0 && pool->solvables[p].repo == solv->installed)