Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libsolv for openSUSE:Factory checked in at 2021-02-23 20:18:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libsolv (Old) and /work/SRC/openSUSE:Factory/.libsolv.new.2378 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libsolv" Tue Feb 23 20:18:56 2021 rev:83 rq:873098 version:0.7.17 Changes: -------- --- /work/SRC/openSUSE:Factory/libsolv/libsolv.changes 2020-10-24 15:16:28.632173756 +0200 +++ /work/SRC/openSUSE:Factory/.libsolv.new.2378/libsolv.changes 2021-02-23 20:20:41.279670720 +0100 @@ -1,0 +2,13 @@ +Tue Jan 19 15:09:12 CET 2021 - [email protected] + +- repo_write: fix handling of nested flexarray +- improve choicerule generation a bit more to cover more cases +- harden testcase parser against repos being added too late +- support python-3.10 +- check %_dbpath macro in rpmdb code +- handle default/visible/langonly attributes in comps parser +- support multiple collections in updateinfo parser +- add '-D' option in rpmdb2solv to set the dbpath +- bump version to 0.7.17 + +------------------------------------------------------------------- Old: ---- libsolv-0.7.16.tar.bz2 New: ---- libsolv-0.7.17.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libsolv.spec ++++++ --- /var/tmp/diff_new_pack.0HZQjG/_old 2021-02-23 20:20:41.751671137 +0100 +++ /var/tmp/diff_new_pack.0HZQjG/_new 2021-02-23 20:20:41.751671137 +0100 @@ -1,7 +1,7 @@ # # spec file for package libsolv # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -52,7 +52,7 @@ %bcond_with zypp Name: libsolv -Version: 0.7.16 +Version: 0.7.17 Release: 0 Summary: Package dependency solver using a satisfiability algorithm License: BSD-3-Clause ++++++ libsolv-0.7.16.tar.bz2 -> libsolv-0.7.17.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.16/NEWS new/libsolv-0.7.17/NEWS --- old/libsolv-0.7.16/NEWS 2020-10-20 12:09:38.000000000 +0200 +++ new/libsolv-0.7.17/NEWS 2021-01-19 15:14:58.000000000 +0100 @@ -2,6 +2,18 @@ This file contains the major changes between libsolv versions: +Version 0.7.17 +- selected bug fixes: + * repo_write: fix handling of nested flexarray + * improve choicerule generation a bit more to cover more cases + * harden testcase parser against repos being added too late + * support python-3.10 + * check %_dbpath macro in rpmdb code +- new features: + * handle default/visible/langonly attributes in comps parser + * support multiple collections in updateinfo parser + * add '-D' option in rpmdb2solv to set the dbpath + Version 0.7.16 - selected bug fixes: * do not ask the namespace callback for splitprovides when writing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.16/VERSION.cmake new/libsolv-0.7.17/VERSION.cmake --- old/libsolv-0.7.16/VERSION.cmake 2020-10-20 12:09:38.000000000 +0200 +++ new/libsolv-0.7.17/VERSION.cmake 2021-01-19 15:14:58.000000000 +0100 @@ -49,5 +49,5 @@ SET(LIBSOLV_MAJOR "0") SET(LIBSOLV_MINOR "7") -SET(LIBSOLV_PATCH "16") +SET(LIBSOLV_PATCH "17") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.16/bindings/solv.i new/libsolv-0.7.17/bindings/solv.i --- old/libsolv-0.7.16/bindings/solv.i 2019-08-13 09:49:46.000000000 +0200 +++ new/libsolv-0.7.17/bindings/solv.i 2020-11-16 15:14:32.000000000 +0100 @@ -44,7 +44,11 @@ #if defined(SWIGPYTHON) const void *pybuf = 0; Py_ssize_t pysize = 0; +%#if PY_VERSION_HEX >= 0x03000000 + res = PyBytes_AsStringAndSize($input, (char **)&pybuf, &pysize); +%#else res = PyObject_AsReadBuffer($input, &pybuf, &pysize); +%#endif if (res < 0) { %argument_fail(res, "BinaryBlob", $symname, $argnum); } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.16/doc/gen/libsolv-bindings.3 new/libsolv-0.7.17/doc/gen/libsolv-bindings.3 --- old/libsolv-0.7.16/doc/gen/libsolv-bindings.3 2020-01-21 15:04:15.000000000 +0100 +++ new/libsolv-0.7.17/doc/gen/libsolv-bindings.3 2020-11-18 13:14:44.000000000 +0100 @@ -2,12 +2,12 @@ .\" Title: Libsolv-Bindings .\" Author: [see the "Author" section] .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> -.\" Date: 01/21/2020 +.\" Date: 11/18/2020 .\" Manual: LIBSOLV .\" Source: libsolv .\" Language: English .\" -.TH "LIBSOLV\-BINDINGS" "3" "01/21/2020" "libsolv" "LIBSOLV" +.TH "LIBSOLV\-BINDINGS" "3" "11/18/2020" "libsolv" "LIBSOLV" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.16/doc/gen/libsolv-pool.3 new/libsolv-0.7.17/doc/gen/libsolv-pool.3 --- old/libsolv-0.7.16/doc/gen/libsolv-pool.3 2020-01-21 15:04:15.000000000 +0100 +++ new/libsolv-0.7.17/doc/gen/libsolv-pool.3 2020-11-18 13:14:44.000000000 +0100 @@ -2,12 +2,12 @@ .\" Title: Libsolv-Pool .\" Author: [see the "Author" section] .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> -.\" Date: 01/21/2020 +.\" Date: 11/18/2020 .\" Manual: LIBSOLV .\" Source: libsolv .\" Language: English .\" -.TH "LIBSOLV\-POOL" "3" "01/21/2020" "libsolv" "LIBSOLV" +.TH "LIBSOLV\-POOL" "3" "11/18/2020" "libsolv" "LIBSOLV" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.16/doc/gen/rpmdb2solv.1 new/libsolv-0.7.17/doc/gen/rpmdb2solv.1 --- old/libsolv-0.7.16/doc/gen/rpmdb2solv.1 2018-10-01 11:09:18.000000000 +0200 +++ new/libsolv-0.7.17/doc/gen/rpmdb2solv.1 2020-11-18 13:14:44.000000000 +0100 @@ -2,12 +2,12 @@ .\" Title: rpmdb2solv .\" Author: [see the "Author" section] .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> -.\" Date: 09/14/2018 +.\" Date: 11/18/2020 .\" Manual: LIBSOLV .\" Source: libsolv .\" Language: English .\" -.TH "RPMDB2SOLV" "1" "09/14/2018" "libsolv" "LIBSOLV" +.TH "RPMDB2SOLV" "1" "11/18/2020" "libsolv" "LIBSOLV" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -55,6 +55,13 @@ as root directory\&. .RE .PP +\fB\-D\fR \fIDBPATH\fR +.RS 4 +Use the database in the +\fIDBPATH\fR +directory\&. +.RE +.PP \fB\-k\fR .RS 4 Read pubkeys from the rpm database instead of installed packages\&. Note that many distributions stopped storing pubkeys in the database but use a directory like @@ -83,6 +90,11 @@ to only convert SUSE products\&. .RE .PP +\fB\-C\fR +.RS 4 +Include the package changelog in the generated solv file\&. +.RE +.PP \fB\-X\fR .RS 4 Autoexpand SUSE pattern and product provides into packages\&. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.16/doc/rpmdb2solv.txt new/libsolv-0.7.17/doc/rpmdb2solv.txt --- old/libsolv-0.7.16/doc/rpmdb2solv.txt 2019-03-27 12:04:27.000000000 +0100 +++ new/libsolv-0.7.17/doc/rpmdb2solv.txt 2020-11-18 13:14:44.000000000 +0100 @@ -29,6 +29,9 @@ *-r* 'ROOTDIR':: Use 'ROOTDIR' as root directory. +*-D* 'DBPATH':: +Use the database in the 'DBPATH' directory. + *-k*:: Read pubkeys from the rpm database instead of installed packages. Note that many distributions stopped storing pubkeys in the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.16/ext/repo_comps.c new/libsolv-0.7.17/ext/repo_comps.c --- old/libsolv-0.7.16/ext/repo_comps.c 2018-12-11 13:59:34.000000000 +0100 +++ new/libsolv-0.7.17/ext/repo_comps.c 2021-01-19 15:00:21.000000000 +0100 @@ -29,7 +29,6 @@ * TODO: * * what's the difference between group/category? - * handle "default" and "langonly". * * maybe handle REL_COND in solver recommends handling? */ @@ -97,10 +96,26 @@ Solvable *solvable; const char *kind; + int isdefault; + int isvisible; Id handle; }; +#define COMPS_DEFAULT_ISVISIBLE 1 +#define COMPS_DEFAULT_ISDEFAULT 0 + +/* Return true if "true", false if "false", default_value otherwise */ +static int +parse_boolean(char *content, int default_value) +{ + if (!strcmp(content, "true")) + return 1; + if (!strcmp(content, "false")) + return 0; + return default_value; +} + static void startElement(struct solv_xmlparser *xmlp, int state, const char *name, const char **atts) @@ -116,6 +131,8 @@ s = pd->solvable = pool_id2solvable(pool, repo_add_solvable(pd->repo)); pd->handle = s - pool->solvables; pd->kind = state == STATE_GROUP ? "group" : "category"; + pd->isvisible = COMPS_DEFAULT_ISVISIBLE; + pd->isdefault = COMPS_DEFAULT_ISDEFAULT; break; case STATE_NAME: @@ -166,6 +183,10 @@ s->evr = ID_EMPTY; if (s->name && s->arch != ARCH_SRC && s->arch != ARCH_NOSRC) s->provides = repo_addid_dep(pd->repo, s->provides, pool_rel2id(pd->pool, s->name, s->evr, REL_EQ, 1), 0); + if (pd->isvisible) + repodata_set_void(pd->data, pd->handle, SOLVABLE_ISVISIBLE); + if (pd->isdefault) + repodata_set_void(pd->data, pd->handle, SOLVABLE_ISDEFAULT); pd->solvable = 0; break; @@ -194,7 +215,19 @@ break; case STATE_USERVISIBLE: - repodata_set_void(pd->data, pd->handle, SOLVABLE_ISVISIBLE); + pd->isvisible = parse_boolean(content, COMPS_DEFAULT_ISVISIBLE); + break; + + case STATE_DEFAULT: + pd->isdefault = parse_boolean(content, COMPS_DEFAULT_ISDEFAULT); + break; + + case STATE_LANG_ONLY: + repodata_set_str(pd->data, pd->handle, SOLVABLE_LANGONLY, content); + break; + + case STATE_LANGONLY: + repodata_set_str(pd->data, pd->handle, SOLVABLE_LANGONLY, content); break; case STATE_DISPLAY_ORDER: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.16/ext/repo_rpmdb.c new/libsolv-0.7.17/ext/repo_rpmdb.c --- old/libsolv-0.7.16/ext/repo_rpmdb.c 2020-09-10 15:19:32.000000000 +0200 +++ new/libsolv-0.7.17/ext/repo_rpmdb.c 2020-11-18 13:14:44.000000000 +0100 @@ -1349,6 +1349,8 @@ #ifdef ENABLE_RPMDB if (state->dbenvopened) closedbenv(state); + if (state->dbpath_allocated) + solv_free((char *)state->dbpath); #endif if (state->rootdir) solv_free(state->rootdir); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.16/ext/repo_rpmdb_bdb.h new/libsolv-0.7.17/ext/repo_rpmdb_bdb.h --- old/libsolv-0.7.16/ext/repo_rpmdb_bdb.h 2020-01-22 13:04:17.000000000 +0100 +++ new/libsolv-0.7.17/ext/repo_rpmdb_bdb.h 2020-11-18 13:14:44.000000000 +0100 @@ -48,6 +48,7 @@ int dbenvopened; /* database environment opened */ int pkgdbopened; /* package database openend */ const char *dbpath; /* path to the database */ + int dbpath_allocated; /* do we need to free the path? */ DB_ENV *dbenv; /* database environment */ DB *db; /* packages database */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.16/ext/repo_rpmdb_librpm.h new/libsolv-0.7.17/ext/repo_rpmdb_librpm.h --- old/libsolv-0.7.16/ext/repo_rpmdb_librpm.h 2020-05-26 14:54:18.000000000 +0200 +++ new/libsolv-0.7.17/ext/repo_rpmdb_librpm.h 2020-12-10 16:44:17.000000000 +0100 @@ -12,6 +12,7 @@ * */ +#include <rpm/rpmlib.h> #include <rpm/rpmts.h> #include <rpm/rpmmacro.h> @@ -24,6 +25,7 @@ int dbenvopened; /* database environment opened */ const char *dbpath; /* path to the database */ + int dbpath_allocated; /* do we need to free the path? */ rpmts ts; rpmdbMatchIterator mi; /* iterator over packages database */ @@ -45,6 +47,13 @@ static void detect_dbpath(struct rpmdbstate *state) { + state->dbpath = rpmExpand("%{?_dbpath}", NULL); + if (state->dbpath && *state->dbpath) + { + state->dbpath_allocated = 1; + return; + } + solv_free((char *)state->dbpath); state->dbpath = access_rootdir(state, "/var/lib/rpm", W_OK) == -1 && (access_rootdir(state, "/usr/share/rpm/Packages", R_OK) == 0 || access_rootdir(state, "/usr/share/rpm/rpmdb.sqlite", R_OK) == 0) ? "/usr/share/rpm" : "/var/lib/rpm"; @@ -90,6 +99,24 @@ return 0; } +/* rpm-4.16.0 cannot read the database if _db_backend is not set */ +#ifndef HAVE_RPMDBNEXTITERATORHEADERBLOB +static void +set_db_backend() +{ + static int db_backend_set; + char *db_backend; + + if (db_backend_set) + return; + db_backend_set = 1; + db_backend = rpmExpand("%{?_db_backend}", NULL); + if (!db_backend || !*db_backend) + rpmReadConfigFiles(NULL, NULL); + solv_free(db_backend); +} +#endif + static int opendbenv(struct rpmdbstate *state) { @@ -108,6 +135,10 @@ delMacro(NULL, "_dbpath"); return 0; } +#ifndef HAVE_RPMDBNEXTITERATORHEADERBLOB + if (!strcmp(RPMVERSION, "4.16.0")) + set_db_backend(); +#endif if (rpmtsOpenDB(ts, O_RDONLY)) { pool_error(state->pool, 0, "rpmtsOpenDB failed: %s", strerror(errno)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.16/ext/repo_updateinfoxml.c new/libsolv-0.7.17/ext/repo_updateinfoxml.c --- old/libsolv-0.7.16/ext/repo_updateinfoxml.c 2020-04-20 17:34:14.000000000 +0200 +++ new/libsolv-0.7.17/ext/repo_updateinfoxml.c 2020-11-06 11:59:51.000000000 +0100 @@ -110,9 +110,10 @@ Id handle; Solvable *solvable; time_t buildtime; - Id collhandle; + Id pkghandle; struct solv_xmlparser xmlp; struct joindata jd; + Id collhandle; }; /* @@ -287,6 +288,12 @@ } break; + case STATE_COLLECTION: + { + pd->collhandle = repodata_new_handle(pd->data); + } + break; + /* <package arch="ppc64" name="imlib-debuginfo" release="6.fc8" * src="http://download.fedoraproject.org/pub/fedora/linux/updates/8/ppc64/imlib-debuginfo-1.9.15-6.fc8.ppc64.rpm" * version="1.9.15"> @@ -326,12 +333,12 @@ solvable->conflicts = repo_addid_dep(pd->repo, solvable->conflicts, id, 0); } - /* who needs the collection anyway? */ - pd->collhandle = repodata_new_handle(pd->data); - repodata_set_id(pd->data, pd->collhandle, UPDATE_COLLECTION_NAME, n); - repodata_set_id(pd->data, pd->collhandle, UPDATE_COLLECTION_EVR, evr); + /* UPDATE_COLLECTION is misnamed, it should have been UPDATE_PACKAGE */ + pd->pkghandle = repodata_new_handle(pd->data); + repodata_set_id(pd->data, pd->pkghandle, UPDATE_COLLECTION_NAME, n); + repodata_set_id(pd->data, pd->pkghandle, UPDATE_COLLECTION_EVR, evr); if (a) - repodata_set_id(pd->data, pd->collhandle, UPDATE_COLLECTION_ARCH, a); + repodata_set_id(pd->data, pd->pkghandle, UPDATE_COLLECTION_ARCH, a); break; } case STATE_MODULE: @@ -364,6 +371,7 @@ if (arch) repodata_set_poolstr(pd->data, module_handle, UPDATE_MODULE_ARCH, arch); repodata_add_flexarray(pd->data, pd->handle, UPDATE_MODULE, module_handle); + repodata_add_flexarray(pd->data, pd->collhandle, UPDATE_MODULE, module_handle); break; } @@ -427,15 +435,21 @@ repodata_set_str(pd->data, pd->handle, UPDATE_MESSAGE, content); break; - case STATE_PACKAGE: - repodata_add_flexarray(pd->data, pd->handle, UPDATE_COLLECTION, pd->collhandle); + case STATE_COLLECTION: + repodata_add_flexarray(pd->data, pd->handle, UPDATE_COLLECTIONLIST, pd->collhandle); pd->collhandle = 0; break; + case STATE_PACKAGE: + repodata_add_flexarray(pd->data, pd->handle, UPDATE_COLLECTION, pd->pkghandle); + repodata_add_flexarray(pd->data, pd->collhandle, UPDATE_COLLECTION, pd->pkghandle); + pd->pkghandle = 0; + break; + /* <filename>libntlm-0.4.2-1.fc8.x86_64.rpm</filename> */ /* <filename>libntlm-0.4.2-1.fc8.x86_64.rpm</filename> */ case STATE_FILENAME: - repodata_set_str(pd->data, pd->collhandle, UPDATE_COLLECTION_FILENAME, content); + repodata_set_str(pd->data, pd->pkghandle, UPDATE_COLLECTION_FILENAME, content); break; /* <reboot_suggested>True</reboot_suggested> */ @@ -444,7 +458,7 @@ { /* FIXME: this is per-package, the global flag should be computed at runtime */ repodata_set_void(pd->data, pd->handle, UPDATE_REBOOT); - repodata_set_void(pd->data, pd->collhandle, UPDATE_REBOOT); + repodata_set_void(pd->data, pd->pkghandle, UPDATE_REBOOT); } break; @@ -454,7 +468,7 @@ { /* FIXME: this is per-package, the global flag should be computed at runtime */ repodata_set_void(pd->data, pd->handle, UPDATE_RESTART); - repodata_set_void(pd->data, pd->collhandle, UPDATE_RESTART); + repodata_set_void(pd->data, pd->pkghandle, UPDATE_RESTART); } break; @@ -464,7 +478,7 @@ { /* FIXME: this is per-package, the global flag should be computed at runtime */ repodata_set_void(pd->data, pd->handle, UPDATE_RELOGIN); - repodata_set_void(pd->data, pd->collhandle, UPDATE_RELOGIN); + repodata_set_void(pd->data, pd->pkghandle, UPDATE_RELOGIN); } break; default: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.16/ext/testcase.c new/libsolv-0.7.17/ext/testcase.c --- old/libsolv-0.7.16/ext/testcase.c 2020-10-20 11:59:24.000000000 +0200 +++ new/libsolv-0.7.17/ext/testcase.c 2020-12-14 11:20:50.000000000 +0100 @@ -1991,6 +1991,7 @@ Id *genid = 0; int ngenid = 0; Queue autoinstq; + int oldjobsize = job ? job->count : 0; if (resultp) *resultp = 0; @@ -2065,6 +2066,21 @@ int prio, subprio; const char *rdata; + if (pool->considered) + { + pool_error(pool, 0, "testcase_read: cannot add repos after packages were disabled"); + continue; + } + if (solv) + { + pool_error(pool, 0, "testcase_read: cannot add repos after the solver was created"); + continue; + } + if (job && job->count != oldjobsize) + { + pool_error(pool, 0, "testcase_read: cannot add repos after jobs have been created"); + continue; + } prepared = 0; if (!poolflagsreset) { @@ -2125,6 +2141,11 @@ int i; /* must set the disttype before the arch */ + if (job && job->count != oldjobsize) + { + pool_error(pool, 0, "testcase_read: cannot change the system after jobs have been created"); + continue; + } prepared = 0; if (strcmp(pieces[2], "*") != 0) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.16/package/libsolv.changes new/libsolv-0.7.17/package/libsolv.changes --- old/libsolv-0.7.16/package/libsolv.changes 2020-10-20 12:09:38.000000000 +0200 +++ new/libsolv-0.7.17/package/libsolv.changes 2021-01-19 15:14:58.000000000 +0100 @@ -1,4 +1,17 @@ ------------------------------------------------------------------- +Tue Jan 19 15:09:12 CET 2021 - [email protected] + +- repo_write: fix handling of nested flexarray +- improve choicerule generation a bit more to cover more cases +- harden testcase parser against repos being added too late +- support python-3.10 +- check %_dbpath macro in rpmdb code +- handle default/visible/langonly attributes in comps parser +- support multiple collections in updateinfo parser +- add '-D' option in rpmdb2solv to set the dbpath +- bump version to 0.7.17 + +------------------------------------------------------------------- Tue Oct 20 12:04:00 CEST 2020 - [email protected] - do not ask the namespace callback for splitprovides when writing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.16/src/knownid.h new/libsolv-0.7.17/src/knownid.h --- old/libsolv-0.7.16/src/knownid.h 2020-09-08 12:03:10.000000000 +0200 +++ new/libsolv-0.7.17/src/knownid.h 2021-01-19 14:44:15.000000000 +0100 @@ -267,6 +267,10 @@ KNOWNID(SOLVABLE_CONSTRAINS, "solvable:constrains"), /* conda */ KNOWNID(SOLVABLE_TRACK_FEATURES, "solvable:track_features"), /* conda */ +KNOWNID(SOLVABLE_ISDEFAULT, "solvable:isdefault"), +KNOWNID(SOLVABLE_LANGONLY, "solvable:langonly"), + +KNOWNID(UPDATE_COLLECTIONLIST, "update:collectionlist"), /* list of UPDATE_COLLECTION (actually packages) and UPDATE_MODULE */ KNOWNID(ID_NUM_INTERNAL, 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.16/src/repo_write.c new/libsolv-0.7.17/src/repo_write.c --- old/libsolv-0.7.16/src/repo_write.c 2019-10-08 14:14:11.000000000 +0200 +++ new/libsolv-0.7.17/src/repo_write.c 2020-11-06 10:31:44.000000000 +0100 @@ -570,25 +570,29 @@ break; case REPOKEY_TYPE_FIXARRAY: case REPOKEY_TYPE_FLEXARRAY: - if (kv->entry == 0) + if (kv->entry) { - if (kv->eof != 2) - *cbdata->sp++ = 0; /* mark start */ - } - else - { - /* just finished a schema, rewind to start */ + /* finish schema, rewind to start */ Id *sp = cbdata->sp - 1; *sp = 0; while (sp[-1]) sp--; - if (kv->entry == 1 || key->type == REPOKEY_TYPE_FLEXARRAY) + if (sp[-2] >= 0) + cbdata->subschemata[sp[-2]] = repodata_schema2id(cbdata->target, sp, 1); + cbdata->sp = sp - 2; + } + if (kv->eof != 2) + { + /* start new schema */ + if (kv->entry == 0 || key->type == REPOKEY_TYPE_FLEXARRAY) { cbdata->subschemata = solv_extend(cbdata->subschemata, cbdata->nsubschemata, 1, sizeof(Id), SCHEMATA_BLOCK); - cbdata->subschemata[cbdata->nsubschemata++] = repodata_schema2id(cbdata->target, sp, 1); + *cbdata->sp++ = cbdata->nsubschemata++; } - cbdata->sp = kv->eof == 2 ? sp - 1: sp; - } + else + *cbdata->sp++ = -1; + *cbdata->sp++ = 0; + } break; default: break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.16/src/rules.c new/libsolv-0.7.17/src/rules.c --- old/libsolv-0.7.16/src/rules.c 2020-10-06 13:44:37.000000000 +0200 +++ new/libsolv-0.7.17/src/rules.c 2020-11-13 16:04:33.000000000 +0100 @@ -3225,6 +3225,40 @@ return 0; /* not newest */ } +static int +solver_choicerulecheck3(Solver *solv, Id pt, Queue *q) +{ + Pool *pool = solv->pool; + Id p, pp; + int i; + + if (!q->count || q->elements[0] != pt) + { + Solvable *s = pool->solvables + pt; + if (q->count) + queue_empty(q); + /* no installed package, so check all with same name */ + queue_push2(q, pt, 0); + FOR_PROVIDES(p, pp, s->name) + if (pool->solvables[p].name == s->name && p != pt) + queue_push(q, p); + queue_push(q, pt); + } + if (q->count <= 3) + return q->count == 3 && q->elements[2] == pt ? 1 : 0; + if (!q->elements[1]) + { + queue_deleten(q, 0, 2); + policy_filter_unwanted(solv, q, POLICY_MODE_CHOOSE); + queue_unshift(q, 1); /* filter mark */ + queue_unshift(q, pt); + } + for (i = 2; i < q->count; i++) + if (q->elements[i] == pt) + return 1; + return 0; /* not newest */ +} + static inline void queue_removeelement(Queue *q, Id el) { @@ -3380,6 +3414,11 @@ { isnewest = 0; break; + } + if (!p2 && !solver_choicerulecheck3(solv, -p, &qcheck2)) + { + isnewest = 0; + break; } } /* do extra checking */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.16/test/testcases/choicerules/choice3.t new/libsolv-0.7.17/test/testcases/choicerules/choice3.t --- old/libsolv-0.7.16/test/testcases/choicerules/choice3.t 1970-01-01 01:00:00.000000000 +0100 +++ new/libsolv-0.7.17/test/testcases/choicerules/choice3.t 2020-11-13 16:04:33.000000000 +0100 @@ -0,0 +1,17 @@ +repo system 0 testtags <inline> +#>=Pkg: A 1 1 noarch +#>=Prv: libA +#>=Pkg: B 1 1 noarch +#>=Req: libA +repo available 0 testtags <inline> +#>=Pkg: B 1 1 noarch +#>=Req: libA +#>=Pkg: A 2 1 noarch +#>=Pkg: Anew 2 1 noarch +#>=Prv: libA +system i686 rpm system + +job update all packages +result transaction,problems <inline> +#>install Anew-2-1.noarch@available +#>upgrade A-1-1.noarch@system A-2-1.noarch@available diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.16/test/testcases/choicerules/choice4.t new/libsolv-0.7.17/test/testcases/choicerules/choice4.t --- old/libsolv-0.7.16/test/testcases/choicerules/choice4.t 1970-01-01 01:00:00.000000000 +0100 +++ new/libsolv-0.7.17/test/testcases/choicerules/choice4.t 2020-11-13 16:04:33.000000000 +0100 @@ -0,0 +1,31 @@ +repo system 0 testtags <inline> +#>=Pkg: A 1 1 noarch +#>=Prv: libA = 1-1 +repo available 0 testtags <inline> +#>=Pkg: A 1 1 noarch +#>=Prv: libA = 1-1 +#>=Pkg: Anew 1 1 noarch +#>=Prv: libA = 1-1 +#>=Pkg: B 1 1 noarch +#>=Req: libA = 1-1 +#>=Pkg: A 2 1 noarch +#>=Prv: libA = 2-1 +#>=Pkg: Anew 2 1 noarch +#>=Prv: libA = 2-1 +#>=Pkg: B 2 1 noarch +#>=Req: libA = 2-1 +#>=Pkg: A 2 2 noarch +#>=Prv: libA = 2-2 +#>=Pkg: Anew 2 2 noarch +#>=Prv: libA = 2-2 +#>=Pkg: B 2 2 noarch +#>=Req: libA = 2-2 +#>=Pkg: C 2 1 noarch +#>=Req: B = 2 +system i686 rpm system + +job install name C +result transaction,problems <inline> +#>install B-2-2.noarch@available +#>install C-2-1.noarch@available +#>upgrade A-1-1.noarch@system A-2-2.noarch@available diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.16/tools/rpmdb2solv.c new/libsolv-0.7.17/tools/rpmdb2solv.c --- old/libsolv-0.7.16/tools/rpmdb2solv.c 2019-03-27 12:04:27.000000000 +0100 +++ new/libsolv-0.7.17/tools/rpmdb2solv.c 2020-12-10 16:44:17.000000000 +0100 @@ -20,6 +20,11 @@ #include <string.h> #include <unistd.h> +#ifdef ENABLE_RPMDB_LIBRPM +#include <rpm/rpmmacro.h> +#endif + + #include "pool.h" #include "repo.h" #include "repo_rpmdb.h" @@ -64,6 +69,7 @@ int nopacks = 0; int add_changelog = 0; const char *root = 0; + const char *dbpath = 0; const char *refname = 0; #ifdef ENABLE_SUSEREPO char *proddir = 0; @@ -83,7 +89,7 @@ * parse arguments */ - while ((c = getopt(argc, argv, "ACPhnkxXr:p:o:")) >= 0) + while ((c = getopt(argc, argv, "ACD:PhnkxXr:p:o:")) >= 0) switch (c) { case 'h': @@ -92,6 +98,9 @@ case 'r': root = optarg; break; + case 'D': + dbpath = optarg; + break; case 'n': nopacks = 1; break; @@ -160,6 +169,21 @@ if (root && *root) pool_set_rootdir(pool, root); +#ifdef ENABLE_PUBKEY + if (dbpath && *dbpath && (!nopacks || pubkeys)) +#else + if (dbpath && *dbpath && !nopacks) +#endif + { +#ifdef ENABLE_RPMDB_LIBRPM + char *macro = solv_dupjoin("_dbpath ", dbpath, 0); + rpmDefineMacro(NULL, macro, 0); + free(macro); +#else + fprintf(stderr, "cannot set dbpath without librpm\n"); + exit(1); +#endif + } repo = repo_create(pool, "installed"); data = repo_add_repodata(repo, 0);
