summaryrefslogtreecommitdiff
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
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>
-rw-r--r--CMakeLists.txt1
-rw-r--r--VERSION.cmake2
-rw-r--r--doc/libsolv-pool.310
-rw-r--r--doc/libsolv-pool.txt7
-rw-r--r--examples/CMakeLists.txt4
-rw-r--r--examples/solv.c16
-rw-r--r--ext/repo_autopattern.c2
-rw-r--r--ext/repo_products.c5
-rw-r--r--package/libsolv.changes6
-rw-r--r--src/knownid.h2
-rw-r--r--src/pool.c33
-rw-r--r--src/pool.h4
-rw-r--r--src/problems.c10
13 files changed, 62 insertions, 40 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7e1e342..ab3fec9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -129,7 +129,6 @@ ENDIF (HAIKU)
IF (${have_system} STREQUAL x)
MESSAGE (STATUS "Building for no system")
- ADD_DEFINITIONS (-DNOSYSTEM)
ENDIF (${have_system} STREQUAL x)
IF (${have_system} STRGREATER xx)
MESSAGE (FATAL_ERROR "Can only compile for one system type.")
diff --git a/VERSION.cmake b/VERSION.cmake
index 20b844e..be0e7e7 100644
--- a/VERSION.cmake
+++ b/VERSION.cmake
@@ -49,5 +49,5 @@ SET(LIBSOLVEXT_SOVERSION "0")
SET(LIBSOLV_MAJOR "0")
SET(LIBSOLV_MINOR "6")
-SET(LIBSOLV_PATCH "6")
+SET(LIBSOLV_PATCH "7")
diff --git a/doc/libsolv-pool.3 b/doc/libsolv-pool.3
index 0db9f8d..1d0e84d 100644
--- a/doc/libsolv-pool.3
+++ b/doc/libsolv-pool.3
@@ -2,12 +2,12 @@
.\" Title: Libsolv-Pool
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.78.0 <http://docbook.sf.net/>
-.\" Date: 09/20/2013
+.\" Date: 10/09/2014
.\" Manual: LIBSOLV
.\" Source: libsolv
.\" Language: English
.\"
-.TH "LIBSOLV\-POOL" "3" "09/20/2013" "libsolv" "LIBSOLV"
+.TH "LIBSOLV\-POOL" "3" "10/09/2014" "libsolv" "LIBSOLV"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -363,13 +363,13 @@ Make the addfileprovides method only add files from the standard locations (i\&.
.RS 4
.\}
.nf
-\fBvoid pool_setdisttype(Pool *\fR\fIpool\fR\fB, int\fR \fIdisttype\fR\fB)\fR;
+\fBint pool_setdisttype(Pool *\fR\fIpool\fR\fB, int\fR \fIdisttype\fR\fB)\fR;
.fi
.if n \{\
.RE
.\}
.sp
-Set the package type of your system\&. The disttype is used for example to define package comparison semantics\&. Libsolv\(cqs default disttype should match the package manager of your system, so you only need to use this function if you want to use the library to solve packaging problems for different systems\&.
+Set the package type of your system\&. The disttype is used for example to define package comparison semantics\&. Libsolv\(cqs default disttype should match the package manager of your system, so you only need to use this function if you want to use the library to solve packaging problems for different systems\&. The Function returns the old disttype on success, and \-1 if the new disttype is not supported\&.
.sp
.if n \{\
.RS 4
@@ -1241,7 +1241,7 @@ There can be multiple equivalence classes, the set of allowed vendor changes for
You can turn off the architecture replacement checks with the Solver\(cqs SOLVER_FLAG_ALLOW_VENDORCHANGE flag\&.
.SH "BOOLEAN DEPENDENCIES"
.sp
-Boolean Dependencies allow to build complex expressions from simple dependencies\&. While rpm does not support boolean expressions in dependencies and debian only allows an "OR" expression, libsolv allows one to arbitrary complex expressions\&. The following basic types are supported:
+Boolean Dependencies allow to build complex expressions from simple dependencies\&. While rpm does not support boolean expressions in dependencies and debian only allows an "OR" expression, libsolv allows arbitrary complex expressions\&. The following basic types are supported:
.PP
\fBREL_OR\fR
.RS 4
diff --git a/doc/libsolv-pool.txt b/doc/libsolv-pool.txt
index 9740b24..8567cbf 100644
--- a/doc/libsolv-pool.txt
+++ b/doc/libsolv-pool.txt
@@ -262,13 +262,14 @@ generates.
=== Functions ===
- void pool_setdisttype(Pool *pool, int disttype);
+ int pool_setdisttype(Pool *pool, int disttype);
Set the package type of your system. The disttype is used for example
to define package comparison semantics. Libsolv's default disttype
should match the package manager of your system, so you only need to
use this function if you want to use the library to solve packaging
-problems for different systems.
+problems for different systems. The Function returns the old
+disttype on success, and -1 if the new disttype is not supported.
int pool_set_flag(Pool *pool, int flag, int value);
@@ -813,7 +814,7 @@ Boolean Dependencies
Boolean Dependencies allow to build complex expressions from simple
dependencies. While rpm does not support boolean expressions in
dependencies and debian only allows an "OR" expression, libsolv
-allows to arbitrary complex expressions. The following basic types
+allows arbitrary complex expressions. The following basic types
are supported:
*REL_OR*::
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 787d2f9..d29ea68 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -1,6 +1,10 @@
+IF (SUSE OR FEDORA OR DEBIAN)
+
ADD_EXECUTABLE (solv solv.c)
TARGET_LINK_LIBRARIES (solv libsolvext libsolv ${SYSTEM_LIBRARIES})
INSTALL(TARGETS
solv
DESTINATION ${BIN_INSTALL_DIR})
+
+ENDIF (SUSE OR FEDORA OR DEBIAN)
diff --git a/examples/solv.c b/examples/solv.c
index 7ae67e3..8b0d6cc 100644
--- a/examples/solv.c
+++ b/examples/solv.c
@@ -216,7 +216,6 @@ yum_substitute(Pool *pool, char *line)
#define TYPE_PLAINDIR 3
#define TYPE_DEBIAN 4
-#ifndef NOSYSTEM
static int
read_repoinfos_sort(const void *ap, const void *bp)
{
@@ -224,7 +223,6 @@ read_repoinfos_sort(const void *ap, const void *bp)
const struct repoinfo *b = bp;
return strcmp(a->alias, b->alias);
}
-#endif
#if defined(SUSE) || defined(FEDORA)
@@ -478,15 +476,6 @@ read_repoinfos(Pool *pool, int *nrepoinfosp)
#endif
-#ifdef NOSYSTEM
-struct repoinfo *
-read_repoinfos(Pool *pool, int *nrepoinfosp)
-{
- *nrepoinfosp = 0;
- return 0;
-}
-#endif
-
void
free_repoinfos(struct repoinfo *repoinfos, int nrepoinfos)
@@ -1733,6 +1722,7 @@ read_repos(Pool *pool, struct repoinfo *repoinfos, int nrepoinfos)
#endif
repo = repo_create(pool, "@System");
+ memset(&stb, 0, sizeof(stb));
#if defined(ENABLE_RPMDB) && (defined(SUSE) || defined(FEDORA))
printf("rpm database:");
if (stat(pool_prepend_rootdir_tmp(pool, "/var/lib/rpm/Packages"), &stb))
@@ -1743,10 +1733,6 @@ read_repos(Pool *pool, struct repoinfo *repoinfos, int nrepoinfos)
if (stat(pool_prepend_rootdir_tmp(pool, "/var/lib/dpkg/status"), &stb))
memset(&stb, 0, sizeof(stb));
#endif
-#ifdef NOSYSTEM
- printf("no installed database:");
- memset(&stb, 0, sizeof(stb));
-#endif
calc_checksum_stat(&stb, REPOKEY_TYPE_SHA256, 0, installedcookie);
if (usecachedrepo(repo, 0, installedcookie, 0))
printf(" cached\n");
diff --git a/ext/repo_autopattern.c b/ext/repo_autopattern.c
index 5132394..7edfc6c 100644
--- a/ext/repo_autopattern.c
+++ b/ext/repo_autopattern.c
@@ -377,6 +377,8 @@ repo_add_autopattern(Repo *repo, int flags)
repodata_set_str(data, s2 - pool->solvables, PRODUCT_SHORTLABEL, newname);
else if (!strcmp(pn, "product-register-target()") && evr)
repodata_set_str(data, s2 - pool->solvables, PRODUCT_REGISTER_TARGET, newname);
+ else if (!strcmp(pn, "product-register-flavor()") && evr)
+ repodata_set_str(data, s2 - pool->solvables, PRODUCT_REGISTER_FLAVOR, newname);
else if (!strcmp(pn, "product-type()") && evr)
repodata_set_str(data, s2 - pool->solvables, PRODUCT_TYPE, newname);
else if (!strcmp(pn, "product-cpeid()") && evr)
diff --git a/ext/repo_products.c b/ext/repo_products.c
index f7a36e1..cb69c49 100644
--- a/ext/repo_products.c
+++ b/ext/repo_products.c
@@ -60,6 +60,7 @@ enum state {
STATE_REGISTER,
STATE_TARGET,
STATE_REGRELEASE,
+ STATE_REGFLAVOR,
STATE_PRODUCTLINE,
STATE_REGUPDATES,
STATE_REGUPDREPO,
@@ -97,6 +98,7 @@ static struct stateswitch stateswitches[] = {
{ STATE_LINGUAS, "lang", STATE_LANG, 0 },
{ STATE_REGISTER, "target", STATE_TARGET, 1 },
{ STATE_REGISTER, "release", STATE_REGRELEASE, 1 },
+ { STATE_REGISTER, "flavor", STATE_REGFLAVOR, 1 },
{ STATE_REGISTER, "updates", STATE_REGUPDATES, 0 },
{ STATE_REGUPDATES, "repository", STATE_REGUPDREPO, 0 },
{ NUMSTATES }
@@ -366,6 +368,9 @@ endElement(void *userData, const char *name)
case STATE_REGRELEASE:
repodata_set_str(pd->data, pd->handle, PRODUCT_REGISTER_RELEASE, pd->content);
break;
+ case STATE_REGFLAVOR:
+ repodata_set_str(pd->data, pd->handle, PRODUCT_REGISTER_FLAVOR, pd->content);
+ break;
case STATE_CPEID:
if (*pd->content)
repodata_set_str(pd->data, pd->handle, SOLVABLE_CPEID, pd->content);
diff --git a/package/libsolv.changes b/package/libsolv.changes
index 9e7f5e6..38d81bb 100644
--- a/package/libsolv.changes
+++ b/package/libsolv.changes
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Fri Dec 19 08:59:27 CET 2014 - ma@suse.de
+
+- add product:regflavor attribute [bnc#896224]
+- bump version to 0.6.7
+
+-------------------------------------------------------------------
Tue Oct 7 14:39:23 CEST 2014 - mls@suse.de
- fix bug in reorder_dq_for_jobrules leading to crashes
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)