Hello community, here is the log from the commit of package libsolv for openSUSE:Factory checked in at 2019-10-28 16:43:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libsolv (Old) and /work/SRC/openSUSE:Factory/.libsolv.new.2990 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libsolv" Mon Oct 28 16:43:28 2019 rev:74 rq:742091 version:0.7.7 Changes: -------- --- /work/SRC/openSUSE:Factory/libsolv/libsolv.changes 2019-09-02 13:23:27.365333816 +0200 +++ /work/SRC/openSUSE:Factory/.libsolv.new.2990/libsolv.changes 2019-10-28 16:43:31.748484333 +0100 @@ -1,0 +2,8 @@ +Fri Oct 18 10:53:54 CEST 2019 - [email protected] + +- fix updating of too many packages in focusbest mode +- fix handling of disabled installed packages in distupgrade +- new POOL_FLAG_WHATPROVIDESWITHDISABLED pool flag +- bump version to 0.7.7 + +------------------------------------------------------------------- Old: ---- libsolv-0.7.6.tar.bz2 New: ---- libsolv-0.7.7.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libsolv.spec ++++++ --- /var/tmp/diff_new_pack.xrwyli/_old 2019-10-28 16:43:32.156484852 +0100 +++ /var/tmp/diff_new_pack.xrwyli/_new 2019-10-28 16:43:32.160484857 +0100 @@ -52,7 +52,7 @@ %bcond_with zypp Name: libsolv -Version: 0.7.6 +Version: 0.7.7 Release: 0 Summary: Package dependency solver using a satisfiability algorithm License: BSD-3-Clause @@ -207,7 +207,7 @@ %setup -q %build -%global _lto_cflags %{_lto_cflags} -ffat-lto-objects +%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects export CFLAGS="%{optflags}" export CXXFLAGS="$CFLAGS" ++++++ libsolv-0.7.6.tar.bz2 -> libsolv-0.7.7.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/NEWS new/libsolv-0.7.7/NEWS --- old/libsolv-0.7.6/NEWS 2019-08-28 15:02:38.000000000 +0200 +++ new/libsolv-0.7.7/NEWS 2019-10-18 10:59:11.000000000 +0200 @@ -2,6 +2,13 @@ This file contains the major changes between libsolv versions: +Version 0.7.7 +- selected bug fixes: + * fix updating of too many packages in focusbest mode + * fix handling of disabled installed packages in distupgrade +- new features + * new POOL_FLAG_WHATPROVIDESWITHDISABLED pool flag + Version 0.7.6 - selected bug fixes: * fix repository priority handling for multiversion packages diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/VERSION.cmake new/libsolv-0.7.7/VERSION.cmake --- old/libsolv-0.7.6/VERSION.cmake 2019-08-28 15:02:38.000000000 +0200 +++ new/libsolv-0.7.7/VERSION.cmake 2019-10-18 10:59:11.000000000 +0200 @@ -49,5 +49,5 @@ SET(LIBSOLV_MAJOR "0") SET(LIBSOLV_MINOR "7") -SET(LIBSOLV_PATCH "6") +SET(LIBSOLV_PATCH "7") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/ext/repo_rpmdb.c new/libsolv-0.7.7/ext/repo_rpmdb.c --- old/libsolv-0.7.6/ext/repo_rpmdb.c 2019-03-27 12:04:27.000000000 +0100 +++ new/libsolv-0.7.7/ext/repo_rpmdb.c 2019-10-21 13:21:14.000000000 +0200 @@ -1605,7 +1605,7 @@ } /* XXX: should get ro lock of Packages database! */ - if (stat_database(&state, "Packages", &packagesstat, 1)) + if (stat_database(&state, &packagesstat)) { freestate(&state); return -1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/ext/repo_rpmdb_bdb.h new/libsolv-0.7.7/ext/repo_rpmdb_bdb.h --- old/libsolv-0.7.6/ext/repo_rpmdb_bdb.h 2019-06-05 16:36:37.000000000 +0200 +++ new/libsolv-0.7.7/ext/repo_rpmdb_bdb.h 2019-10-21 13:21:14.000000000 +0200 @@ -57,7 +57,7 @@ static int -stat_database(struct rpmdbstate *state, char *dbname, struct stat *statbuf, int seterror) +stat_database_name(struct rpmdbstate *state, char *dbname, struct stat *statbuf, int seterror) { char *dbpath; dbpath = solv_dupjoin(state->rootdir, state->is_ostree ? "/usr/share/rpm/" : "/var/lib/rpm/", dbname); @@ -72,6 +72,13 @@ return 0; } +static int +stat_database(struct rpmdbstate *state, struct stat *statbuf) +{ + return stat_database_name(state, "Packages", statbuf, 1); +} + + static inline Id db2rpmdbid(unsigned char *db, int byteswapped) { @@ -426,7 +433,7 @@ DBT dbkey; DBT dbdata; - if (stat_database(state, "Name", &statbuf, 0)) + if (stat_database_name(state, "Name", &statbuf, 0)) return 0; memset(&dbkey, 0, sizeof(dbkey)); memset(&dbdata, 0, sizeof(dbdata)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/ext/repo_rpmdb_librpm.h new/libsolv-0.7.7/ext/repo_rpmdb_librpm.h --- old/libsolv-0.7.6/ext/repo_rpmdb_librpm.h 2018-10-01 11:09:18.000000000 +0200 +++ new/libsolv-0.7.7/ext/repo_rpmdb_librpm.h 2019-10-21 14:59:05.000000000 +0200 @@ -31,18 +31,34 @@ }; static int -stat_database(struct rpmdbstate *state, char *dbname, struct stat *statbuf, int seterror) +stat_database(struct rpmdbstate *state, struct stat *statbuf) { - char *dbpath; - dbpath = solv_dupjoin(state->rootdir, state->is_ostree ? "/usr/share/rpm/" : "/var/lib/rpm/", dbname); - if (stat(dbpath, statbuf)) + static const char *dbname[] = { + "Packages", + "Packages.db", + "rpmdb.sqlite", + "data.mdb", + "Packages", /* for error reporting */ + 0, + }; + int i; + + for (i = 0; ; i++) { - if (seterror) - pool_error(state->pool, -1, "%s: %s", dbpath, strerror(errno)); - free(dbpath); - return -1; + char *dbpath = solv_dupjoin(state->rootdir, state->is_ostree ? "/usr/share/rpm/" : "/var/lib/rpm/", dbname[i]); + if (!stat(dbpath, statbuf)) + { + free(dbpath); + return 0; + } + if (errno != ENOENT || !dbname[i + 1]) + { + pool_error(state->pool, -1, "%s: %s", dbpath, strerror(errno)); + solv_free(dbpath); + return -1; + } + solv_free(dbpath); } - free(dbpath); return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/ext/repo_updateinfoxml.c new/libsolv-0.7.7/ext/repo_updateinfoxml.c --- old/libsolv-0.7.6/ext/repo_updateinfoxml.c 2019-02-13 14:06:08.000000000 +0100 +++ new/libsolv-0.7.7/ext/repo_updateinfoxml.c 2019-10-18 11:09:11.000000000 +0200 @@ -220,7 +220,7 @@ */ case STATE_UPDATE: { - const char *from = 0, *type = 0, *version = 0; + const char *from = 0, *type = 0, *version = 0, *status = 0; for (; *atts; atts += 2) { if (!strcmp(*atts, "from")) @@ -229,6 +229,8 @@ type = atts[1]; else if (!strcmp(*atts, "version")) version = atts[1]; + else if (!strcmp(*atts, "status")) + status = atts[1]; } solvable = pd->solvable = pool_id2solvable(pool, repo_add_solvable(pd->repo)); pd->handle = pd->solvable - pool->solvables; @@ -238,6 +240,8 @@ solvable->arch = ARCH_NOARCH; if (type) repodata_set_str(pd->data, pd->handle, SOLVABLE_PATCHCATEGORY, type); + if (status) + repodata_set_poolstr(pd->data, pd->handle, UPDATE_STATUS, status); pd->buildtime = (time_t)0; } break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/ext/testcase.c new/libsolv-0.7.7/ext/testcase.c --- old/libsolv-0.7.6/ext/testcase.c 2019-04-18 15:57:18.000000000 +0200 +++ new/libsolv-0.7.7/ext/testcase.c 2019-09-30 14:39:28.000000000 +0200 @@ -152,6 +152,7 @@ { POOL_FLAG_NOOBSOLETESMULTIVERSION, "noobsoletesmultiversion", 0 }, { POOL_FLAG_ADDFILEPROVIDESFILTERED, "addfileprovidesfiltered", 0 }, { POOL_FLAG_NOWHATPROVIDESAUX, "nowhatprovidesaux", 0 }, + { POOL_FLAG_WHATPROVIDESWITHDISABLED, "whatprovideswithdisabled", 0 }, { 0, 0, 0 } }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/package/libsolv.changes new/libsolv-0.7.7/package/libsolv.changes --- old/libsolv-0.7.6/package/libsolv.changes 2019-08-28 15:02:38.000000000 +0200 +++ new/libsolv-0.7.7/package/libsolv.changes 2019-10-18 10:59:11.000000000 +0200 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Fri Oct 18 10:53:54 CEST 2019 - [email protected] + +- fix updating of too many packages in focusbest mode +- fix handling of disabled installed packages in distupgrade +- new POOL_FLAG_WHATPROVIDESWITHDISABLED pool flag +- bump version to 0.7.7 + +------------------------------------------------------------------- Wed Aug 28 14:49:19 CEST 2019 - [email protected] - Fix repository priority handling for multiversion packages diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/package/libsolv.spec.in new/libsolv-0.7.7/package/libsolv.spec.in --- old/libsolv-0.7.6/package/libsolv.spec.in 2019-07-12 14:14:36.000000000 +0200 +++ new/libsolv-0.7.7/package/libsolv.spec.in 2019-10-14 12:09:10.000000000 +0200 @@ -207,7 +207,7 @@ %setup -q %build -%global _lto_cflags %{_lto_cflags} -ffat-lto-objects +%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects export CFLAGS="%{optflags}" export CXXFLAGS="$CFLAGS" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/src/knownid.h new/libsolv-0.7.7/src/knownid.h --- old/libsolv-0.7.6/src/knownid.h 2019-04-03 15:04:19.000000000 +0200 +++ new/libsolv-0.7.7/src/knownid.h 2019-10-18 13:37:20.000000000 +0200 @@ -261,6 +261,8 @@ KNOWNID(SOLVABLE_BUILDVERSION, "solvable:buildversion"), /* conda */ KNOWNID(SOLVABLE_BUILDFLAVOR, "solvable:buildflavor"), /* conda */ +KNOWNID(UPDATE_STATUS, "update:status"), /* "stable", "testing", ...*/ + KNOWNID(ID_NUM_INTERNAL, 0) #ifdef KNOWNID_INITIALIZE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/src/libsolv.ver new/libsolv-0.7.7/src/libsolv.ver --- old/libsolv-0.7.6/src/libsolv.ver 2019-04-04 16:28:06.000000000 +0200 +++ new/libsolv-0.7.7/src/libsolv.ver 2019-10-22 14:13:12.000000000 +0200 @@ -325,6 +325,7 @@ solvable_lookup_type; solvable_lookup_void; solvable_matchesdep; + solvable_matchessolvable; solvable_selfprovidedep; solvable_set_deparray; solvable_set_id; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/src/order.c new/libsolv-0.7.7/src/order.c --- old/libsolv-0.7.6/src/order.c 2018-12-11 13:59:34.000000000 +0100 +++ new/libsolv-0.7.7/src/order.c 2019-10-08 14:14:11.000000000 +0200 @@ -598,6 +598,7 @@ POOL_DEBUG(SOLV_DEBUG_STATS, "\n"); } +#if 0 static inline void dump_tes(struct orderdata *od) { @@ -628,6 +629,7 @@ } } } +#endif static void reachable(struct orderdata *od, Id i) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/src/policy.c new/libsolv-0.7.7/src/policy.c --- old/libsolv-0.7.6/src/policy.c 2019-04-18 15:48:07.000000000 +0200 +++ new/libsolv-0.7.7/src/policy.c 2019-09-30 14:39:28.000000000 +0200 @@ -1579,6 +1579,8 @@ continue; ps = pool->solvables + p; + if (pool->considered && pool->whatprovideswithdisabled && ps->repo != pool->installed && pool_disabled_solvable(pool, ps)) + continue; if (s->name == ps->name) /* name match */ { if (pool->implicitobsoleteusescolors && !pool_colormatch(pool, s, ps)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/src/pool.c new/libsolv-0.7.7/src/pool.c --- old/libsolv-0.7.6/src/pool.c 2019-07-15 16:59:24.000000000 +0200 +++ new/libsolv-0.7.7/src/pool.c 2019-10-22 14:13:12.000000000 +0200 @@ -202,6 +202,8 @@ return pool->addfileprovidesfiltered; case POOL_FLAG_NOWHATPROVIDESAUX: return pool->nowhatprovidesaux; + case POOL_FLAG_WHATPROVIDESWITHDISABLED: + return pool->whatprovideswithdisabled; default: break; } @@ -247,6 +249,9 @@ case POOL_FLAG_NOWHATPROVIDESAUX: pool->nowhatprovidesaux = value; break; + case POOL_FLAG_WHATPROVIDESWITHDISABLED: + pool->whatprovideswithdisabled = value; + break; default: break; } @@ -450,7 +455,6 @@ Offset *whatprovides; Id *whatprovidesdata, *dp, *whatprovidesauxdata; Offset *whatprovidesaux; - Repo *installed = pool->installed; unsigned int now; now = solv_timems(0); @@ -473,9 +477,7 @@ s = pool->solvables + i; if (!s->provides || !s->repo || s->repo->disabled) continue; - /* we always need the installed solvable in the whatprovides data, - otherwise obsoletes/conflicts on them won't work */ - if (s->repo != installed && !pool_installable(pool, s)) + if (!pool_installable_whatprovides(pool, s)) continue; pp = s->repo->idarraydata + s->provides; while ((id = *pp++) != 0) @@ -534,9 +536,8 @@ s = pool->solvables + i; if (!s->provides || !s->repo || s->repo->disabled) continue; - if (s->repo != installed && !pool_installable(pool, s)) + if (!pool_installable_whatprovides(pool, s)) continue; - /* for all provides of this solvable */ pp = s->repo->idarraydata + s->provides; while ((id = *pp++) != 0) @@ -963,7 +964,7 @@ * and those should not use filelist entries */ if (s->repo->disabled) continue; - if (s->repo != pool->installed && !pool_installable(pool, s)) + if (!pool_installable_whatprovides(pool, s)) continue; queue_push(&q, di.solvid); } @@ -1243,7 +1244,7 @@ FOR_POOL_SOLVABLES(p) { Solvable *s = pool->solvables + p; - if (s->repo != pool->installed && !pool_installable(pool, s)) + if (!pool_installable_whatprovides(pool, s)) continue; if (s->arch == evr) queue_push(&plist, p); @@ -1541,7 +1542,7 @@ continue; if (s->repo != pool->installed && !pool_installable(pool, s)) continue; - if (solvable_matchessolvable_int(s, keyname, marker, solvid, 0, &qq, &missc, reloff)) + if (solvable_matchessolvable_int(s, keyname, marker, solvid, 0, &qq, &missc, reloff, 0)) queue_push(q, p); } map_free(&missc); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/src/pool.h new/libsolv-0.7.7/src/pool.h --- old/libsolv-0.7.6/src/pool.h 2019-03-28 15:14:22.000000000 +0100 +++ new/libsolv-0.7.7/src/pool.h 2019-09-30 14:39:28.000000000 +0200 @@ -166,6 +166,7 @@ Id *whatprovidesauxdata; Offset whatprovidesauxdataoff; + int whatprovideswithdisabled; #endif }; @@ -204,6 +205,7 @@ #define POOL_FLAG_ADDFILEPROVIDESFILTERED 9 #define POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS 10 #define POOL_FLAG_NOWHATPROVIDESAUX 11 +#define POOL_FLAG_WHATPROVIDESWITHDISABLED 12 /* ----------------------------------------------- */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/src/repo.h new/libsolv-0.7.7/src/repo.h --- old/libsolv-0.7.6/src/repo.h 2018-11-22 12:59:31.000000000 +0100 +++ new/libsolv-0.7.7/src/repo.h 2019-09-30 14:39:28.000000000 +0200 @@ -123,6 +123,26 @@ return 1; } +#ifdef LIBSOLV_INTERNAL +static inline int pool_installable_whatprovides(const Pool *pool, Solvable *s) +{ + /* we always need the installed solvable in the whatprovides data, + otherwise obsoletes/conflicts on them won't work */ + if (s->repo != pool->installed) + { + if (s->arch == ARCH_SRC || s->arch == ARCH_NOSRC || pool_badarch_solvable(pool, s)) + return 0; + if (pool->considered && !pool->whatprovideswithdisabled) + { + Id id = s - pool->solvables; + if (!MAPTST(pool->considered, id)) + return 0; + } + } + return 1; +} +#endif + /* not in solvable.h because we need the repo definition */ static inline Solvable *solvable_free(Solvable *s, int reuseids) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/src/repo_write.c new/libsolv-0.7.7/src/repo_write.c --- old/libsolv-0.7.6/src/repo_write.c 2018-10-31 13:04:31.000000000 +0100 +++ new/libsolv-0.7.7/src/repo_write.c 2019-10-08 14:14:11.000000000 +0200 @@ -187,16 +187,6 @@ } static inline void -write_id_eof(Repodata *data, Id x, int eof) -{ - if (x >= 64) - x = (x & 63) | ((x & ~63) << 1); - write_id(data, x | (eof ? 0 : 64)); -} - - - -static inline void write_str(Repodata *data, const char *str) { if (data->error) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/src/rules.c new/libsolv-0.7.7/src/rules.c --- old/libsolv-0.7.6/src/rules.c 2019-06-03 15:49:47.000000000 +0200 +++ new/libsolv-0.7.7/src/rules.c 2019-10-08 13:42:19.000000000 +0200 @@ -1373,6 +1373,14 @@ int dupinvolved = 0; p = s - pool->solvables; + + if (pool->considered && pool_disabled_solvable(pool, s)) + { + /* disabled installed solvables must stay installed */ + solver_addrule(solv, p, 0, 0); + return; + } + /* Orphan detection. We cheat by looking at the feature rule, which * we already calculated */ r = solv->rules + solv->featurerules + (p - solv->installed->start); @@ -2003,6 +2011,8 @@ continue; if (installed && ps->repo == installed) { + if (pool->considered && pool_disabled_solvable(pool, ps)) + continue; /* always keep disabled installed packages */ if (!MAPTST(&solv->dupmap, p)) { Id ip, ipp; @@ -3323,6 +3333,21 @@ policy_filter_unwanted(solv, q, POLICY_MODE_RECOMMEND); } +static void +prune_disabled(Pool *pool, Queue *q) +{ + int i, j; + for (i = j = 0; i < q->count; i++) + { + Id p = q->elements[i]; + Solvable *s = pool->solvables + p; + if (s->repo && s->repo != pool->installed && !MAPTST(pool->considered, p)) + continue; + q->elements[j++] = p; + } + queue_truncate(q, j); +} + void solver_addbestrules(Solver *solv, int havebestinstalljobs, int haslockjob) { @@ -3377,6 +3402,8 @@ else if (p2 < 0) queue_push(&q2, p2); } + if (pool->considered && pool->whatprovideswithdisabled) + prune_disabled(pool, &q); if (!q.count) continue; /* orphaned */ /* select best packages, just look at prio and version */ @@ -3386,6 +3413,8 @@ continue; /* nothing filtered */ if (lockedmap) { + queue_insertn(&q, 0, q2.count, q2.elements); + queue_empty(&q2); FOR_RULELITERALS(p2, pp2, r) { if (p2 <= 0) @@ -3399,9 +3428,12 @@ continue; queue_push(&q2, p2); } + if (pool->considered && pool->whatprovideswithdisabled) + prune_disabled(pool, &q2); policy_filter_unwanted(solv, &q2, POLICY_MODE_RECOMMEND); for (k = 0; k < q2.count; k++) queue_pushunique(&q, q2.elements[k]); + queue_empty(&q2); } if (q2.count) queue_insertn(&q, 0, q2.count, q2.elements); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/src/selection.c new/libsolv-0.7.7/src/selection.c --- old/libsolv-0.7.6/src/selection.c 2019-06-03 16:10:13.000000000 +0200 +++ new/libsolv-0.7.7/src/selection.c 2019-10-22 14:13:12.000000000 +0200 @@ -1502,7 +1502,7 @@ continue; if (!solvable_matches_selection_flags(pool, s, flags)) continue; - if (solvable_matchessolvable_int(s, keyname, marker, solvid, solvidq ? &m : 0, &q, &missc, reloff)) + if (solvable_matchessolvable_int(s, keyname, marker, solvid, solvidq ? &m : 0, &q, &missc, reloff, 0)) queue_push(selection, p); } queue_free(&q); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/src/solvable.c new/libsolv-0.7.7/src/solvable.c --- old/libsolv-0.7.6/src/solvable.c 2019-06-03 16:10:13.000000000 +0200 +++ new/libsolv-0.7.7/src/solvable.c 2019-10-22 14:22:01.000000000 +0200 @@ -645,7 +645,7 @@ } int -solvable_matchessolvable_int(Solvable *s, Id keyname, int marker, Id solvid, Map *solvidmap, Queue *depq, Map *missc, int reloff) +solvable_matchessolvable_int(Solvable *s, Id keyname, int marker, Id solvid, Map *solvidmap, Queue *depq, Map *missc, int reloff, Queue *outdepq) { Pool *pool = s->repo->pool; int i, boff; @@ -653,6 +653,8 @@ if (depq->count) queue_empty(depq); + if (outdepq && outdepq->count) + queue_empty(outdepq); solvable_lookup_deparray(s, keyname, depq, marker); for (i = 0; i < depq->count; i++) { @@ -695,15 +697,46 @@ { for (; *wp; wp++) if (MAPTST(solvidmap, *wp)) - return 1; + break; } else { for (; *wp; wp++) if (*wp == solvid) - return 1; + break; + } + if (*wp) + { + if (outdepq) + { + queue_pushunique(outdepq, dep); + continue; + } + return 1; } MAPSET(missc, boff); } - return 0; + return outdepq && outdepq->count ? 1 : 0; +} + +int +solvable_matchessolvable(Solvable *s, Id keyname, Id solvid, Queue *depq, int marker) +{ + Pool *pool = s->repo->pool; + Map missc; /* cache for misses */ + int res, reloff; + Queue qq; + + if (depq && depq->count) + queue_empty(depq); + if (s - pool->solvables == solvid) + return 0; /* no self-matches */ + + queue_init(&qq); + reloff = pool->ss.nstrings; + map_init(&missc, reloff + pool->nrels); + res = solvable_matchessolvable_int(s, keyname, marker, solvid, 0, &qq, &missc, reloff, depq); + map_free(&missc); + queue_free(&qq); + return res; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/src/solvable.h new/libsolv-0.7.7/src/solvable.h --- old/libsolv-0.7.6/src/solvable.h 2018-10-22 15:37:12.000000000 +0200 +++ new/libsolv-0.7.7/src/solvable.h 2019-10-22 14:22:01.000000000 +0200 @@ -81,9 +81,10 @@ Id solvable_selfprovidedep(Solvable *s); int solvable_matchesdep(Solvable *s, Id keyname, Id dep, int marker); +int solvable_matchessolvable(Solvable *s, Id keyname, Id solvid, Queue *depq, int marker); /* internal */ -int solvable_matchessolvable_int(Solvable *s, Id keyname, int marker, Id solvid, Map *solvidmap, Queue *depq, Map *missc, int reloff); +int solvable_matchessolvable_int(Solvable *s, Id keyname, int marker, Id solvid, Map *solvidmap, Queue *depq, Map *missc, int reloff, Queue *outdepq); /* weird suse stuff */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/src/solver.c new/libsolv-0.7.7/src/solver.c --- old/libsolv-0.7.6/src/solver.c 2019-08-02 16:34:26.000000000 +0200 +++ new/libsolv-0.7.7/src/solver.c 2019-09-25 15:40:25.000000000 +0200 @@ -1910,6 +1910,8 @@ Rule *r; int origlevel = level; Id p, *dp; + int focusbest = solv->focus_best && solv->do_extra_reordering; + Repo *installed = solv->installed; /* * decide @@ -1928,7 +1930,7 @@ } if (i == solv->nrules) i = 1; - if (solv->focus_best && solv->do_extra_reordering && i >= solv->featurerules) + if (focusbest && i >= solv->featurerules) continue; r = solv->rules + i; if (r->d < 0) /* ignore disabled rules */ @@ -1938,6 +1940,19 @@ if (r->d == 0 || solv->decisionmap[-r->p] <= 0) continue; } + if (focusbest && r->d != 0 && installed) + { + /* make sure at least one negative literal is from a new package */ + if (!(r->p < 0 && pool->solvables[-r->p].repo != installed)) + { + dp = pool->whatprovidesdata + r->d; + while ((p = *dp++) != 0) + if (p < 0 && solv->decisionmap[-p] > 0 && pool->solvables[-p].repo != installed) + break; + if (!p) + continue; /* sorry */ + } + } if (dq->count) queue_empty(dq); if (r->d == 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/test/testcases/whatprovideswithdisabled/dup.t new/libsolv-0.7.7/test/testcases/whatprovideswithdisabled/dup.t --- old/libsolv-0.7.6/test/testcases/whatprovideswithdisabled/dup.t 1970-01-01 01:00:00.000000000 +0100 +++ new/libsolv-0.7.7/test/testcases/whatprovideswithdisabled/dup.t 2019-10-08 13:42:19.000000000 +0200 @@ -0,0 +1,14 @@ +repo system 0 testtags <inline> +#>=Pkg: A 1 1 noarch +#>=Vnd: foo +repo available 0 testtags <inline> +#>=Pkg: A 2 1 noarch +#>=Vnd: foo +system i686 rpm system +poolflags whatprovideswithdisabled + +disable pkg A-2-1.noarch@available + +job distupgrade all packages +result transaction,problems <inline> + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/test/testcases/whatprovideswithdisabled/dup2.t new/libsolv-0.7.7/test/testcases/whatprovideswithdisabled/dup2.t --- old/libsolv-0.7.6/test/testcases/whatprovideswithdisabled/dup2.t 1970-01-01 01:00:00.000000000 +0100 +++ new/libsolv-0.7.7/test/testcases/whatprovideswithdisabled/dup2.t 2019-10-08 13:42:19.000000000 +0200 @@ -0,0 +1,14 @@ +repo system 0 testtags <inline> +#>=Pkg: A 1 1 noarch +#>=Vnd: foo +repo available 0 testtags <inline> +#>=Pkg: A 2 1 noarch +#>=Vnd: foo +system i686 rpm system +poolflags whatprovideswithdisabled + +disable pkg A-1-1.noarch@system + +job distupgrade all packages +result transaction,problems <inline> + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/test/testcases/whatprovideswithdisabled/forcebest_in.t new/libsolv-0.7.7/test/testcases/whatprovideswithdisabled/forcebest_in.t --- old/libsolv-0.7.6/test/testcases/whatprovideswithdisabled/forcebest_in.t 1970-01-01 01:00:00.000000000 +0100 +++ new/libsolv-0.7.7/test/testcases/whatprovideswithdisabled/forcebest_in.t 2019-10-08 13:42:19.000000000 +0200 @@ -0,0 +1,19 @@ +repo system 0 testtags <inline> +#>=Pkg: D 1 1 noarch +#>=Vnd: foo +#>=Con: A = 3-1 +repo available 0 testtags <inline> +#>=Pkg: A 2 1 noarch +#>=Vnd: foo +#>=Pkg: A 3 1 noarch +#>=Vnd: bar +system i686 rpm system + +poolflags whatprovideswithdisabled +disable pkg A-3-1.noarch@available + +job install name A [forcebest] +result transaction,problems <inline> +#>install A-2-1.noarch@available + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.7.6/test/testcases/whatprovideswithdisabled/forcebest_up.t new/libsolv-0.7.7/test/testcases/whatprovideswithdisabled/forcebest_up.t --- old/libsolv-0.7.6/test/testcases/whatprovideswithdisabled/forcebest_up.t 1970-01-01 01:00:00.000000000 +0100 +++ new/libsolv-0.7.7/test/testcases/whatprovideswithdisabled/forcebest_up.t 2019-10-08 13:42:19.000000000 +0200 @@ -0,0 +1,20 @@ +repo system 0 testtags <inline> +#>=Pkg: A 1 1 noarch +#>=Vnd: foo +#>=Pkg: D 1 1 noarch +#>=Vnd: foo +#>=Con: A = 3-1 +repo available 0 testtags <inline> +#>=Pkg: A 2 1 noarch +#>=Vnd: foo +#>=Pkg: A 3 1 noarch +#>=Vnd: bar +system i686 rpm system + +poolflags whatprovideswithdisabled +disable pkg A-3-1.noarch@available + +job install name A [forcebest] +result transaction,problems <inline> +#>upgrade A-1-1.noarch@system A-2-1.noarch@available +
