summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2016-10-27 14:53:44 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2016-10-27 14:53:44 +0900
commit0254042972e8b301303ad00678e5388e7722b440 (patch)
tree3e9f1f5ac6f74d12d02b64613caa2704a681718c /src
parentef6e8f8da0690f0e11c12eff0f6e7fa97c109d54 (diff)
downloadlibsolv-0254042972e8b301303ad00678e5388e7722b440.tar.gz
libsolv-0254042972e8b301303ad00678e5388e7722b440.tar.bz2
libsolv-0254042972e8b301303ad00678e5388e7722b440.zip
Imported Upstream version 0.6.7upstream/0.6.7
Change-Id: I4903b1e04cf23c0c38f633e48a06732764ee6444 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'src')
-rw-r--r--src/knownid.h2
-rw-r--r--src/pool.c33
-rw-r--r--src/pool.h4
-rw-r--r--src/problems.c10
4 files changed, 34 insertions, 15 deletions
diff --git a/src/knownid.h b/src/knownid.h
index 45a290f..a229121 100644
--- a/src/knownid.h
+++ b/src/knownid.h
@@ -256,6 +256,8 @@ KNOWNID(SIGNATURE_TIME, "signature:time"),
KNOWNID(SIGNATURE_EXPIRES, "signature:expires"),
KNOWNID(SIGNATURE_DATA, "signature:data"),
+KNOWNID(PRODUCT_REGISTER_FLAVOR, "product:regflavor"), /* installed and available product */
+
KNOWNID(ID_NUM_INTERNAL, 0)
#ifdef KNOWNID_INITIALIZE
diff --git a/src/pool.c b/src/pool.c
index 8dff38a..8de4cc5 100644
--- a/src/pool.c
+++ b/src/pool.c
@@ -141,22 +141,33 @@ pool_freeallrepos(Pool *pool, int reuseids)
pool_free_solvable_block(pool, 2, pool->nsolvables - 2, reuseids);
}
-#ifdef MULTI_SEMANTICS
-void
+int
pool_setdisttype(Pool *pool, int disttype)
{
+#ifdef MULTI_SEMANTICS
+ int olddisttype = pool->disttype;
+ switch(disttype)
+ {
+ case DISTTYPE_RPM:
+ pool->noarchid = ARCH_NOARCH;
+ break;
+ case DISTTYPE_DEB:
+ pool->noarchid = ARCH_ALL;
+ break;
+ case DISTTYPE_ARCH:
+ case DISTTYPE_HAIKU:
+ pool->noarchid = ARCH_ANY;
+ break;
+ default:
+ return -1;
+ }
pool->disttype = disttype;
- if (disttype == DISTTYPE_RPM)
- pool->noarchid = ARCH_NOARCH;
- if (disttype == DISTTYPE_DEB)
- pool->noarchid = ARCH_ALL;
- if (disttype == DISTTYPE_ARCH)
- pool->noarchid = ARCH_ANY;
- if (disttype == DISTTYPE_HAIKU)
- pool->noarchid = ARCH_ANY;
pool->solvables[SYSTEMSOLVABLE].arch = pool->noarchid;
-}
+ return olddisttype;
+#else
+ return pool->disttype == disttype ? disttype : -1;
#endif
+}
int
pool_get_flag(Pool *pool, int flag)
diff --git a/src/pool.h b/src/pool.h
index 9761ce1..f6e5d29 100644
--- a/src/pool.h
+++ b/src/pool.h
@@ -225,9 +225,7 @@ extern void pool_free(Pool *pool);
extern void pool_freeallrepos(Pool *pool, int reuseids);
extern void pool_setdebuglevel(Pool *pool, int level);
-#ifdef MULTI_SEMANTICS
-extern void pool_setdisttype(Pool *pool, int disttype);
-#endif
+extern int pool_setdisttype(Pool *pool, int disttype);
extern int pool_set_flag(Pool *pool, int flag, int value);
extern int pool_get_flag(Pool *pool, int flag);
diff --git a/src/problems.c b/src/problems.c
index c82baa8..528aa2e 100644
--- a/src/problems.c
+++ b/src/problems.c
@@ -588,7 +588,7 @@ create_solutions(Solver *solv, int probnr, int solidx)
{
Pool *pool = solv->pool;
Queue redoq;
- Queue problem, solution, problems_save;
+ Queue problem, solution, problems_save, branches_save;
int i, j, nsol;
int essentialok;
unsigned int now;
@@ -620,6 +620,10 @@ create_solutions(Solver *solv, int probnr, int solidx)
problems_save = solv->problems;
memset(&solv->problems, 0, sizeof(solv->problems));
+ /* save branches queue */
+ branches_save = solv->problems;
+ memset(&solv->branches, 0, sizeof(solv->branches));
+
/* extract problem from queue */
queue_init(&problem);
for (i = solidx + 1; i < solv->solutions.count; i++)
@@ -717,6 +721,10 @@ create_solutions(Solver *solv, int probnr, int solidx)
queue_free(&solv->problems);
solv->problems = problems_save;
+ /* restore branches */
+ queue_free(&solv->branches);
+ solv->branches = branches_save;
+
if (solv->cleandeps_mistakes)
{
if (oldmistakes)