- use namespace instead of solvable for languages
authorMichael Schroeder <mls@suse.de>
Wed, 30 Jan 2008 14:56:38 +0000 (14:56 +0000)
committerMichael Schroeder <mls@suse.de>
Wed, 30 Jan 2008 14:56:38 +0000 (14:56 +0000)
  (breaks some test cases, solv files have to be regenerated)

src/pool.c
src/pool.h
src/repo.c
src/solver.c

index 192e71c..f4524ac 100644 (file)
@@ -55,6 +55,7 @@ static const char *initpool_data[] = {
   "namespace:installed",
   "namespace:modalias",
   "namespace:splitprovides",
+  "namespace:language",
   "system:system",
   "src",
   "nosrc",
index c2969fe..7b6a11a 100644 (file)
@@ -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 */
index 845a494..fd6abe3 100644 (file)
@@ -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
index 334ebdf..7ad82d7 100644 (file)
@@ -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)