Hello community, here is the log from the commit of package libsolv for openSUSE:Factory checked in at 2014-02-16 09:10:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libsolv (Old) and /work/SRC/openSUSE:Factory/.libsolv.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libsolv" Changes: -------- --- /work/SRC/openSUSE:Factory/libsolv/libsolv.changes 2014-01-29 07:16:09.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.libsolv.new/libsolv.changes 2014-02-16 09:10:33.000000000 +0100 @@ -1,0 +2,12 @@ +Fri Feb 14 11:03:18 CET 2014 - [email protected] + +- always keep job/jobflags in selection_filter() +- implement COND handling in supplements/enhances +- improve OR handling in supplements/enhances +- fix typo in application backlink creation +- support PRODUCT_ENDOFLIFE +- store repoid as flexarray +- also translate autoproduct strings +- bump version to 0.4.4 + +------------------------------------------------------------------- Old: ---- libsolv-0.4.3.tar.bz2 New: ---- libsolv-0.4.4.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libsolv.spec ++++++ --- /var/tmp/diff_new_pack.em5v54/_old 2014-02-16 09:10:34.000000000 +0100 +++ /var/tmp/diff_new_pack.em5v54/_new 2014-02-16 09:10:34.000000000 +0100 @@ -17,7 +17,7 @@ Name: libsolv -Version: 0.4.3 +Version: 0.4.4 Release: 0 Url: git://gitorious.org/opensuse/libsolv.git Source: libsolv-%{version}.tar.bz2 ++++++ libsolv-0.4.3.tar.bz2 -> libsolv-0.4.4.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.3/VERSION.cmake new/libsolv-0.4.4/VERSION.cmake --- old/libsolv-0.4.3/VERSION.cmake 2014-01-27 17:15:52.000000000 +0100 +++ new/libsolv-0.4.4/VERSION.cmake 2014-02-14 11:05:52.000000000 +0100 @@ -49,5 +49,5 @@ SET(LIBSOLV_MAJOR "0") SET(LIBSOLV_MINOR "4") -SET(LIBSOLV_PATCH "3") +SET(LIBSOLV_PATCH "4") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.3/ext/repo_autopattern.c new/libsolv-0.4.4/ext/repo_autopattern.c --- old/libsolv-0.4.3/ext/repo_autopattern.c 2014-01-27 16:30:52.000000000 +0100 +++ new/libsolv-0.4.4/ext/repo_autopattern.c 2014-01-30 17:10:53.000000000 +0100 @@ -5,6 +5,9 @@ * for further information */ +#define _GNU_SOURCE +#define _XOPEN_SOURCE +#include <time.h> #include <sys/types.h> #include <sys/stat.h> #include <stdio.h> @@ -55,6 +58,30 @@ *q = 0; } +static time_t +datestr2timestamp(const char *date) +{ + const char *p; + struct tm tm; + + if (!date || !*date) + return 0; + for (p = date; *p >= '0' && *p <= '9'; p++) + ; + if (!*p) + return atoi(date); + memset(&tm, 0, sizeof(tm)); + p = strptime(date, "%F%T", &tm); + if (!p) + { + memset(&tm, 0, sizeof(tm)); + p = strptime(date, "%F", &tm); + if (!p || *p) + return 0; + } + return timegm(&tm); +} + int repo_add_autopattern(Repo *repo, int flags) { @@ -73,6 +100,9 @@ queue_init(&prdq); queue_init(&prdq2); + if (repo == pool->installed) + flags |= ADD_NO_AUTOPRODUCTS; /* no auto products for installed repos */ + pattern_id = pool_str2id(pool, "pattern()", 9); product_id = pool_str2id(pool, "product()", 9); FOR_REPO_SOLVABLES(repo, p, s) @@ -226,8 +256,8 @@ queue_free(&patq); queue_free(&patq2); - if (repo == pool->installed) - queue_empty(&prdq2); /* no auto products for installed repos */ + if ((flags & ADD_NO_AUTOPRODUCTS) != 0) + queue_empty(&prdq2); for (i = 0; i < prdq2.count; i += 2) { @@ -336,7 +366,17 @@ else if (!strcmp(pn, "product-flags()") && evr) repodata_add_poolstr_array(data, s2 - pool->solvables, PRODUCT_FLAGS, newname); else if (!strcmp(pn, "product-updates-repoid()") && evr) - repodata_add_poolstr_array(data, s2 - pool->solvables, PRODUCT_UPDATES_REPOID, newname); + { + Id h = repodata_new_handle(data); + repodata_set_str(data, h, PRODUCT_UPDATES_REPOID, newname); + repodata_add_flexarray(data, s2 - pool->solvables, PRODUCT_UPDATES, h); + } + else if (!strcmp(pn, "product-endoflife()") && evr) + { + time_t t = datestr2timestamp(newname); + if (t) + repodata_set_num(data, s2 - pool->solvables, PRODUCT_ENDOFLIFE, t); + } else if (!strncmp(pn, "product-url(", 12) && evr && pn[12] && pn[13] && strlen(pn + 12) < 32) { char type[34]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.3/ext/repo_autopattern.h new/libsolv-0.4.4/ext/repo_autopattern.h --- old/libsolv-0.4.3/ext/repo_autopattern.h 2013-10-16 16:31:42.000000000 +0200 +++ new/libsolv-0.4.4/ext/repo_autopattern.h 2014-01-28 13:45:51.000000000 +0100 @@ -5,4 +5,6 @@ * for further information */ +#define ADD_NO_AUTOPRODUCTS (1 << 8) + extern int repo_add_autopattern(Repo *repo, int flags); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.3/ext/repo_products.c new/libsolv-0.4.4/ext/repo_products.c --- old/libsolv-0.4.3/ext/repo_products.c 2014-01-27 16:30:52.000000000 +0100 +++ new/libsolv-0.4.4/ext/repo_products.c 2014-01-30 17:10:53.000000000 +0100 @@ -11,6 +11,9 @@ * for further information */ +#define _GNU_SOURCE +#define _XOPEN_SOURCE +#include <time.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> @@ -60,6 +63,7 @@ STATE_PRODUCTLINE, STATE_REGUPDATES, STATE_REGUPDREPO, + STATE_ENDOFLIFE, NUMSTATES }; @@ -88,6 +92,7 @@ { STATE_PRODUCT, "linguas", STATE_LINGUAS, 0 }, { STATE_PRODUCT, "updaterepokey", STATE_UPDATEREPOKEY, 1 }, { STATE_PRODUCT, "cpeid", STATE_CPEID, 1 }, + { STATE_PRODUCT, "endoflife", STATE_ENDOFLIFE, 1 }, { STATE_URLS, "url", STATE_URL, 1 }, { STATE_LINGUAS, "lang", STATE_LANG, 0 }, { STATE_REGISTER, "target", STATE_TARGET, 1 }, @@ -152,6 +157,29 @@ return 0; } +static time_t +datestr2timestamp(const char *date) +{ + const char *p; + struct tm tm; + + if (!date || !*date) + return 0; + for (p = date; *p >= '0' && *p <= '9'; p++) + ; + if (!*p) + return atoi(date); + memset(&tm, 0, sizeof(tm)); + p = strptime(date, "%F%T", &tm); + if (!p) + { + memset(&tm, 0, sizeof(tm)); + p = strptime(date, "%F", &tm); + if (!p || *p) + return 0; + } + return timegm(&tm); +} /* * XML callback: startElement @@ -226,7 +254,12 @@ { const char *repoid = find_attr("repoid", atts); if (repoid && *repoid) - repodata_add_poolstr_array(pd->data, pd->handle, PRODUCT_UPDATES_REPOID, repoid); + { + Id h = repodata_new_handle(pd->data); + repodata_set_str(pd->data, h, PRODUCT_UPDATES_REPOID, repoid); + repodata_add_flexarray(pd->data, pd->handle, PRODUCT_UPDATES, h); + } + break; } default: break; @@ -336,6 +369,15 @@ case STATE_CPEID: if (*pd->content) repodata_set_str(pd->data, pd->handle, SOLVABLE_CPEID, pd->content); + break; + case STATE_ENDOFLIFE: + if (*pd->content) + { + time_t t = datestr2timestamp(pd->content); + if (t) + repodata_set_num(pd->data, pd->handle, PRODUCT_ENDOFLIFE, (unsigned long long)t); + } + break; default: break; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.3/ext/testcase.c new/libsolv-0.4.4/ext/testcase.c --- old/libsolv-0.4.3/ext/testcase.c 2014-01-08 14:30:53.000000000 +0100 +++ new/libsolv-0.4.4/ext/testcase.c 2014-02-12 19:55:52.000000000 +0100 @@ -125,6 +125,7 @@ { DISTTYPE_RPM, "rpm" }, { DISTTYPE_DEB, "deb" }, { DISTTYPE_ARCH, "arch" }, + { DISTTYPE_HAIKU, "haiku" }, { 0, 0 } }; @@ -286,21 +287,14 @@ return 1; } -Id -testcase_str2dep(Pool *pool, char *s) +static Id +testcase_str2dep_simple(Pool *pool, const char **sp) { - char *n, *a; + const char *s = *sp; + const char *n, *a; Id id, evr; int flags; - if ((n = strchr(s, '|')) != 0) - { - id = testcase_str2dep(pool, n + 1); - *n = 0; - id = pool_rel2id(pool, testcase_str2dep(pool, s), id, REL_OR, 1); - *n = '|'; - return id; - } while (*s == ' ' || *s == '\t') s++; n = s; @@ -310,9 +304,9 @@ { while (*s && *s != ')') s++; + continue; } - else - s++; + s++; } if ((a = strchr(n, '.')) != 0 && a + 1 < s && s[-1] != ')') { @@ -333,7 +327,10 @@ else id = pool_strn2id(pool, n, s - n, 1); if (!*s) - return id; + { + *sp = s; + return id; + } while (*s == ' ' || *s == '\t') s++; flags = 0; @@ -354,7 +351,10 @@ break; } if (!flags) - return id; + { + *sp = s; + return id; + } while (*s == ' ' || *s == '\t') s++; n = s; @@ -371,9 +371,41 @@ s++; evr = pool_rel2id(pool, evr, pool_strn2id(pool, n, s - n, 1), REL_COMPAT, 1); } + *sp = s; return pool_rel2id(pool, id, evr, flags, 1); } +static Id +testcase_str2dep_complex(Pool *pool, const char **sp) +{ + const char *s = *sp; + Id id; + id = testcase_str2dep_simple(pool, &s); + if (*s == '|') + { + s++; + id = pool_rel2id(pool, id, testcase_str2dep_complex(pool, &s), REL_OR, 1); + } + else if (*s == '&') + { + s++; + id = pool_rel2id(pool, id, testcase_str2dep_complex(pool, &s), REL_AND, 1); + } + else if (*s == 'I' && s[1] == 'F' && (s[2] == ' ' || s[2] == '\t')) + { + s += 2; + id = pool_rel2id(pool, id, testcase_str2dep_complex(pool, &s), REL_COND, 1); + } + *sp = s; + return id; +} + +Id +testcase_str2dep(Pool *pool, const char *s) +{ + return testcase_str2dep_complex(pool, &s); +} + const char * testcase_repoid2str(Pool *pool, Id repoid) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.3/ext/testcase.h new/libsolv-0.4.4/ext/testcase.h --- old/libsolv-0.4.3/ext/testcase.h 2013-03-20 11:31:29.000000000 +0100 +++ new/libsolv-0.4.4/ext/testcase.h 2014-02-12 19:55:52.000000000 +0100 @@ -15,7 +15,7 @@ #define TESTCASE_RESULT_RECOMMENDED (1 << 3) #define TESTCASE_RESULT_UNNEEDED (1 << 4) -extern Id testcase_str2dep(Pool *pool, char *s); +extern Id testcase_str2dep(Pool *pool, const char *s); extern const char *testcase_repoid2str(Pool *pool, Id repoid); extern const char *testcase_solvid2str(Pool *pool, Id p); extern Repo *testcase_str2repo(Pool *pool, const char *str); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.3/package/libsolv.changes new/libsolv-0.4.4/package/libsolv.changes --- old/libsolv-0.4.3/package/libsolv.changes 2014-01-27 17:15:52.000000000 +0100 +++ new/libsolv-0.4.4/package/libsolv.changes 2014-02-14 11:05:52.000000000 +0100 @@ -1,4 +1,16 @@ ------------------------------------------------------------------- +Fri Feb 14 11:03:18 CET 2014 - [email protected] + +- always keep job/jobflags in selection_filter() +- implement COND handling in supplements/enhances +- improve OR handling in supplements/enhances +- fix typo in application backlink creation +- support PRODUCT_ENDOFLIFE +- store repoid as flexarray +- also translate autoproduct strings +- bump version to 0.4.4 + +------------------------------------------------------------------- Mon Jan 27 17:15:41 CET 2014 - [email protected] - add support for autogenerated products diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.3/src/knownid.h new/libsolv-0.4.4/src/knownid.h --- old/libsolv-0.4.3/src/knownid.h 2014-01-27 16:30:52.000000000 +0100 +++ new/libsolv-0.4.4/src/knownid.h 2014-01-30 17:10:53.000000000 +0100 @@ -264,6 +264,8 @@ KNOWNID(DELTA_LOCATION_BASE, "delta:locbase"), /* <location xml:base=... > */ KNOWNID(PRODUCT_UPDATES_REPOID, "product:updates:repoid"), +KNOWNID(PRODUCT_UPDATES, "product:updates"), +KNOWNID(PRODUCT_ENDOFLIFE, "product:endoflife"), KNOWNID(ID_NUM_INTERNAL, 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.3/src/linkedpkg.c new/libsolv-0.4.4/src/linkedpkg.c --- old/libsolv-0.4.3/src/linkedpkg.c 2013-10-17 12:01:42.000000000 +0200 +++ new/libsolv-0.4.4/src/linkedpkg.c 2014-02-04 14:35:52.000000000 +0100 @@ -86,7 +86,7 @@ { FOR_PROVIDES(p, pp, prv) if (pool->solvables[p].repo == s->repo) - queue_push(qp, pp); + queue_push(qp, p); } if (reqidp) *reqidp = req; @@ -212,6 +212,9 @@ *prvidp = aprel; } +/* the following two functions are used in solvable_lookup_str_base to do + * translated lookups on the product/pattern packages + */ Id find_autopattern_name(Pool *pool, Solvable *s) { @@ -227,6 +230,22 @@ } return 0; } + +Id +find_autoproduct_name(Pool *pool, Solvable *s) +{ + Id prv, *prvp; + if (!s->provides) + return 0; + for (prvp = s->repo->idarraydata + s->provides; (prv = *prvp++) != 0; ) + if (ISRELDEP(prv)) + { + Reldep *rd = GETRELDEP(pool, prv); + if (rd->flags == REL_EQ && !strcmp(pool_id2str(pool, rd->name), "autoproduct()")) + return strncmp(pool_id2str(pool, rd->evr), "product:", 8) != 0 ? rd->evr : 0; + } + return 0; +} void find_package_link(Pool *pool, Solvable *s, Id *reqidp, Queue *qr, Id *prvidp, Queue *qp) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.3/src/linkedpkg.h new/libsolv-0.4.4/src/linkedpkg.h --- old/libsolv-0.4.3/src/linkedpkg.h 2013-10-16 12:06:44.000000000 +0200 +++ new/libsolv-0.4.4/src/linkedpkg.h 2014-01-28 13:45:51.000000000 +0100 @@ -30,6 +30,7 @@ extern void find_pattern_link(Pool *pool, Solvable *s, Id *reqidp, Queue *qr, Id *prvidp, Queue *qp); extern Id find_autopattern_name(Pool *pool, Solvable *s); +extern Id find_autoproduct_name(Pool *pool, Solvable *s); /* generic */ extern void find_package_link(Pool *pool, Solvable *s, Id *reqidp, Queue *qr, Id *prvidp, Queue *qp); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.3/src/rules.c new/libsolv-0.4.4/src/rules.c --- old/libsolv-0.4.3/src/rules.c 2013-12-17 13:35:52.000000000 +0100 +++ new/libsolv-0.4.4/src/rules.c 2014-02-12 19:55:52.000000000 +0100 @@ -50,13 +50,19 @@ { Reldep *rd = GETRELDEP(pool, dep); if (rd->flags >= 8) - { - if (rd->flags == REL_AND) + { + if (rd->flags == REL_AND || rd->flags == REL_COND) { if (!dep_possible(solv, rd->name, m)) return 0; return dep_possible(solv, rd->evr, m); } + if (rd->flags == REL_OR) + { + if (dep_possible(solv, rd->name, m)) + return 1; + return dep_possible(solv, rd->evr, m); + } if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_SPLITPROVIDES) return solver_splitprovides(solv, rd->evr); if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_INSTALLED) @@ -71,6 +77,18 @@ return 0; } +static inline int +is_otherproviders_dep(Pool *pool, Id dep) +{ + if (ISRELDEP(dep)) + { + Reldep *rd = GETRELDEP(pool, dep); + if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_OTHERPROVIDERS) + return 1; + } + return 0; +} + /******************************************************************** * * Rule handling @@ -540,19 +558,11 @@ Pool *pool = solv->pool; Repo *installed = solv->installed; - /* 'work' queue. keeps Ids of solvables we still have to work on. - And buffer for it. */ - Queue workq; + Queue workq; /* list of solvables we still have to work on */ Id workqbuf[64]; int i; - /* if to add rules for broken deps ('rpm -V' functionality) - * 0 = yes, 1 = no - */ - int dontfix; - /* Id var and pointer for each dependency - * (not used in parallel) - */ + int dontfix; /* ignore dependency errors for installed solvables */ Id req, *reqp; Id con, *conp; Id obs, *obsp; @@ -581,7 +591,7 @@ MAPSET(m, n); /* mark as visited */ } - s = pool->solvables + n; /* s = Solvable in question */ + s = pool->solvables + n; dontfix = 0; if (installed /* Installed system available */ @@ -598,7 +608,7 @@ ? pool_disabled_solvable(pool, s) : !pool_installable(pool, s)) { - POOL_DEBUG(SOLV_DEBUG_RULE_CREATION, "package %s [%d] is not installable\n", pool_solvable2str(pool, s), (Id)(s - pool->solvables)); + POOL_DEBUG(SOLV_DEBUG_RULE_CREATION, "package %s [%d] is not installable\n", pool_solvid2str(pool, n), n); addrpmrule(solv, -n, 0, SOLVER_RULE_RPM_NOT_INSTALLABLE, 0); } } @@ -633,16 +643,12 @@ * that are already broken. so if we find one provider * that was already installed, we know that the * dependency was not broken before so we enforce it */ - - /* check if any of the providers for 'req' is installed */ for (i = 0; (p = dp[i]) != 0; i++) - { - if (pool->solvables[p].repo == installed) - break; /* provider was installed */ - } - /* didn't find an installed provider: previously broken dependency */ + if (pool->solvables[p].repo == installed) + break; /* found installed provider */ if (!p) { + /* didn't find an installed provider: previously broken dependency */ POOL_DEBUG(SOLV_DEBUG_RULE_CREATION, "ignoring broken requires %s of installed package %s\n", pool_dep2str(pool, req), pool_solvable2str(pool, s)); continue; } @@ -650,8 +656,7 @@ if (!*dp) { - /* nothing provides req! */ - POOL_DEBUG(SOLV_DEBUG_RULE_CREATION, "package %s [%d] is not installable (%s)\n", pool_solvable2str(pool, s), (Id)(s - pool->solvables), pool_dep2str(pool, req)); + POOL_DEBUG(SOLV_DEBUG_RULE_CREATION, "package %s [%d] is not installable (%s)\n", pool_solvid2str(pool, n), n, pool_dep2str(pool, req)); addrpmrule(solv, -n, 0, SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP, req); continue; } @@ -667,20 +672,13 @@ /* rule: (-requestor|provider1|provider2|...|providerN) */ addrpmrule(solv, -n, dp - pool->whatprovidesdata, SOLVER_RULE_RPM_PACKAGE_REQUIRES, req); - /* descend the dependency tree - push all non-visited providers on the work queue */ + /* push all non-visited providers on the work queue */ if (m) - { - for (; *dp; dp++) - { - if (!MAPTST(m, *dp)) - queue_push(&workq, *dp); - } - } - - } /* while, requirements of n */ - - } /* if, requirements */ + for (; *dp; dp++) + if (!MAPTST(m, *dp)) + queue_push(&workq, *dp); + } + } /* that's all we check for src packages */ if (s->arch == ARCH_SRC || s->arch == ARCH_NOSRC) @@ -714,24 +712,20 @@ /* dontfix: dont care about conflicts with already installed packs */ if (dontfix && pool->solvables[p].repo == installed) continue; - /* p == n: self conflict */ - if (p == n && pool->forbidselfconflicts) + if (p == n) /* p == n: self conflict */ { - if (ISRELDEP(con)) - { - Reldep *rd = GETRELDEP(pool, con); - if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_OTHERPROVIDERS) - continue; - } - p = 0; /* make it a negative assertion, aka 'uninstallable' */ + if (!pool->forbidselfconflicts || is_otherproviders_dep(pool, con)) + continue; + addrpmrule(solv, -n, 0, SOLVER_RULE_RPM_SELF_CONFLICT, con); + continue; } - if (p && ispatch && solv->multiversion.size && MAPTST(&solv->multiversion, p) && ISRELDEP(con)) + if (ispatch && solv->multiversion.size && MAPTST(&solv->multiversion, p) && ISRELDEP(con)) { /* our patch conflicts with a multiversion package */ p = -makemultiversionconflict(solv, p, con); } - /* rule: -n|-p: either solvable _or_ provider of conflict */ - addrpmrule(solv, -n, -p, p ? SOLVER_RULE_RPM_PACKAGE_CONFLICT : SOLVER_RULE_RPM_SELF_CONFLICT, con); + /* rule: -n|-p: either solvable _or_ provider of conflict */ + addrpmrule(solv, -n, -p, SOLVER_RULE_RPM_PACKAGE_CONFLICT, con); } } } @@ -1058,6 +1052,29 @@ if (!allow_all && !solv->dupmap_all && solv->dupinvolvedmap.size && MAPTST(&solv->dupinvolvedmap, p)) addduppackages(solv, s, &qs); +#ifdef ENABLE_LINKED_PKGS + if (solv->instbuddy && solv->instbuddy[s - pool->solvables - solv->installed->start]) + { + const char *name = pool_id2str(pool, s->name); + if (strncmp(name, "pattern:", 8) == 0 || strncmp(name, "application:", 12) == 0) + { + /* a linked pseudo package. As it is linked, we do not need an update rule */ + /* nevertheless we set specialupdaters so we can update */ + solver_addrule(solv, 0, 0); + if (!allow_all && qs.count) + { + if (p != -SYSTEMSOLVABLE) + queue_unshift(&qs, p); + if (!solv->specialupdaters) + solv->specialupdaters = solv_calloc(solv->installed->end - solv->installed->start, sizeof(Id)); + solv->specialupdaters[s - pool->solvables - solv->installed->start] = pool_queuetowhatprovides(pool, &qs); + } + queue_free(&qs); + return; + } + } +#endif + if (!allow_all && qs.count && solv->multiversion.size) { int i, j; @@ -1087,9 +1104,9 @@ if (d && solv->installed && s->repo == solv->installed && (solv->updatemap_all || (solv->updatemap.size && MAPTST(&solv->updatemap, s - pool->solvables - solv->installed->start)))) { - if (!solv->multiversionupdaters) - solv->multiversionupdaters = solv_calloc(solv->installed->end - solv->installed->start, sizeof(Id)); - solv->multiversionupdaters[s - pool->solvables - solv->installed->start] = d; + if (!solv->specialupdaters) + solv->specialupdaters = solv_calloc(solv->installed->end - solv->installed->start, sizeof(Id)); + solv->specialupdaters[s - pool->solvables - solv->installed->start] = d; } if (j == 0 && p == -SYSTEMSOLVABLE && solv->dupmap_all) { @@ -1965,8 +1982,10 @@ if (pool->solvables[p].repo == installed) { queue_push2(q, DISABLE_UPDATE, p); +#ifdef ENABLE_LINKED_PKGS if (solv->instbuddy && solv->instbuddy[p - installed->start] > 1) queue_push2(q, DISABLE_UPDATE, solv->instbuddy[p - installed->start]); +#endif } return; default: @@ -2187,7 +2206,7 @@ w2 = pool->whatprovidesdata[d]; d = 0; } - if (p > 0 && d < 0) /* this hack is used for buddy deps */ + if (p > 0 && d < 0) /* this hack is used for package links and complex deps */ { w2 = p; p = d; @@ -2272,33 +2291,25 @@ getrpmruleinfos(Solver *solv, Rule *r, Queue *rq) { Pool *pool = solv->pool; -#ifdef ENABLE_LINKED_PKGS - Id l, d; -#endif + Id l, pp; if (r->p >= 0) return; queue_push(rq, r - solv->rules); /* push the rule we're interested in */ solv->ruleinfoq = rq; - solver_addrpmrulesforsolvable(solv, pool->solvables - r->p, 0); - /* also try reverse direction for conflicts */ - if ((r->d == 0 || r->d == -1) && r->w2 < 0) - solver_addrpmrulesforsolvable(solv, pool->solvables - r->w2, 0); -#ifdef ENABLE_LINKED_PKGS - /* check linked packages */ - d = 0; - if ((r->d == 0 || r->d == -1)) - l = r->w2; - else + FOR_RULELITERALS(l, pp, r) { - d = r->d < 0 ? -r->d - 1 : r->d; - l = pool->whatprovidesdata[d++]; + if (l >= 0) + break; + solver_addrpmrulesforsolvable(solv, pool->solvables - l, 0); } - for (; l; l = (d ? pool->whatprovidesdata[d++] : 0)) +#ifdef ENABLE_LINKED_PKGS + FOR_RULELITERALS(l, pp, r) { - if (l <= 0 || !strchr(pool_id2str(pool, pool->solvables[l].name), ':')) + if (l < 0 || l != r->p) + break; + if (!strchr(pool_id2str(pool, pool->solvables[l].name), ':') || !has_package_link(pool, pool->solvables + l)) break; - if (has_package_link(pool, pool->solvables + l)) - add_package_link(solv, pool->solvables + l, 0, 0); + add_package_link(solv, pool->solvables + l, 0, 0); } #endif solv->ruleinfoq = 0; @@ -2991,9 +3002,9 @@ if (!r->p) /* identical to update rule? */ r = solv->rules + solv->updaterules + (p - installed->start); } - if (solv->multiversionupdaters && (d = solv->multiversionupdaters[p - installed->start]) != 0 && r == solv->rules + solv->updaterules + (p - installed->start)) + if (solv->specialupdaters && (d = solv->specialupdaters[p - installed->start]) != 0 && r == solv->rules + solv->updaterules + (p - installed->start)) { - /* need to check multiversionupdaters */ + /* need to check specialupdaters */ if (r->p == p) /* be careful with the dup case */ queue_push(&q, p); while ((p2 = pool->whatprovidesdata[d++]) != 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.3/src/selection.c new/libsolv-0.4.4/src/selection.c --- old/libsolv-0.4.3/src/selection.c 2014-01-08 14:46:53.000000000 +0100 +++ new/libsolv-0.4.4/src/selection.c 2014-02-13 14:05:52.000000000 +0100 @@ -998,8 +998,11 @@ if (sel1->count == 2 && (sel1->elements[0] & SOLVER_SELECTMASK) == SOLVER_SOLVABLE_ALL) { /* XXX: not 100% correct, but very useful */ + p = sel1->elements[0] & ~(SOLVER_SELECTMASK | SOLVER_SETMASK); /* job & jobflags */ queue_free(sel1); queue_init_clone(sel1, sel2); + for (i = 0; i < sel1->count; i += 2) + sel1->elements[i] = (sel1->elements[i] & (SOLVER_SELECTMASK | SOLVER_SETMASK)) | p ; return; } queue_init(&q1); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.3/src/solvable.c new/libsolv-0.4.4/src/solvable.c --- old/libsolv-0.4.3/src/solvable.c 2014-01-08 14:30:53.000000000 +0100 +++ new/libsolv-0.4.4/src/solvable.c 2014-01-28 13:45:51.000000000 +0100 @@ -172,9 +172,18 @@ return str; } #ifdef ENABLE_LINKED_PKGS - /* autopattern translation magic */ - if (pass && !strncmp("pattern:", pool_id2str(pool, name), 8) && (name = find_autopattern_name(pool, s)) != 0) - pass = -1; + /* autopattern/product translation magic */ + if (pass) + { + const char *n = pool_id2str(pool, name); + if (*n == 'p') + { + if (!strncmp("pattern:", n, 8) && (name = find_autopattern_name(pool, s)) != 0) + pass = -1; + if (!strncmp("product:", n, 8) && (name = find_autoproduct_name(pool, s)) != 0) + pass = -1; + } + } #endif } return usebase ? basestr : 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.3/src/solver.c new/libsolv-0.4.4/src/solver.c --- old/libsolv-0.4.3/src/solver.c 2014-01-23 14:25:52.000000000 +0100 +++ new/libsolv-0.4.4/src/solver.c 2014-02-04 15:00:52.000000000 +0100 @@ -1585,7 +1585,7 @@ solv_free(solv->watches); solv_free(solv->obsoletes); solv_free(solv->obsoletes_data); - solv_free(solv->multiversionupdaters); + solv_free(solv->specialupdaters); solv_free(solv->choicerules_ref); solv_free(solv->bestrules_pkg); solv_free(solv->instbuddy); @@ -1900,7 +1900,7 @@ for (pass = solv->updatemap.size ? 0 : 1; pass < 2; pass++) { int passlevel = level; - Id *multiversionupdaters = solv->multiversion.size ? solv->multiversionupdaters : 0; + Id *specialupdaters = solv->specialupdaters; if (pass == 1 && !solv->decisioncnt_keep) solv->decisioncnt_keep = solv->decisionq.count; /* start with installedpos, the position that gave us problems the last time */ @@ -1915,7 +1915,7 @@ if (s->repo != installed) continue; - if (solv->decisionmap[i] > 0 && (!multiversionupdaters || !multiversionupdaters[i - installed->start])) + if (solv->decisionmap[i] > 0 && (!specialupdaters || !specialupdaters[i - installed->start])) continue; /* already decided */ if (!pass && solv->updatemap.size && !MAPTST(&solv->updatemap, i - installed->start)) continue; /* updates first */ @@ -1925,16 +1925,17 @@ rr -= solv->installed->end - solv->installed->start; if (!rr->p) /* identical to update rule? */ rr = r; - if (!rr->p) + if (!rr->p && (!specialupdaters || !specialupdaters[i - installed->start])) continue; /* orpaned package */ /* check if we should update this package to the latest version * noupdate is set for erase jobs, in that case we want to deinstall - * the installed package and not replace it with a newer version */ + * the installed package and not replace it with a newer version + * rr->p != i is for dup jobs where the installed package cannot be kept */ queue_empty(&dq); - if (!MAPTST(&solv->noupdate, i - installed->start) && (solv->decisionmap[i] < 0 || solv->updatemap_all || (solv->updatemap.size && MAPTST(&solv->updatemap, i - installed->start)) || rr->p != i)) + if (!MAPTST(&solv->noupdate, i - installed->start) && (solv->decisionmap[i] < 0 || solv->updatemap_all || (solv->updatemap.size && MAPTST(&solv->updatemap, i - installed->start)) || (rr->p && rr->p != i))) { - if (multiversionupdaters && (d = multiversionupdaters[i - installed->start]) != 0) + if (specialupdaters && (d = specialupdaters[i - installed->start]) != 0) { /* special multiversion handling, make sure best version is chosen */ if (rr->p == i && solv->decisionmap[i] >= 0) @@ -1944,7 +1945,7 @@ queue_push(&dq, p); if (dq.count && solv->update_targets && solv->update_targets->elements[i - installed->start]) prune_to_update_targets(solv, solv->update_targets->elements + solv->update_targets->elements[i - installed->start], &dq); - if (dq.count) + if (dq.count && rr->p) { policy_filter_unwanted(solv, &dq, POLICY_MODE_CHOOSE); p = dq.elements[0]; @@ -2153,9 +2154,7 @@ continue; /* start over */ } - /* at this point we have a consistent system. now do the extras... */ - - /* first decide leftover cleandeps packages */ + /* decide leftover cleandeps packages */ if (solv->cleandepsmap.size && solv->installed) { for (p = solv->installed->start; p < solv->installed->end; p++) @@ -2176,6 +2175,8 @@ continue; } + /* at this point we have a consistent system. now do the extras... */ + if (!solv->decisioncnt_weak) solv->decisioncnt_weak = solv->decisionq.count; if (doweak) @@ -2490,7 +2491,25 @@ } } - if (solv->installed && solv->cleandepsmap.size) + /* one final pass to make sure we decided all installed packages */ + if (solv->installed) + { + for (p = solv->installed->start; p < solv->installed->end; p++) + { + if (solv->decisionmap[p]) + continue; /* already decided */ + s = pool->solvables + p; + if (s->repo != solv->installed) + continue; + POOL_DEBUG(SOLV_DEBUG_SOLVER, "removing unwanted %s\n", pool_solvid2str(pool, p)); + olevel = level; + level = setpropagatelearn(solv, level, -p, 0, 0); + if (level < olevel) + break; + } + } + + if (solv->installed && solv->cleandepsmap.size) { if (cleandeps_check_mistakes(solv, level)) { @@ -2500,7 +2519,7 @@ } } - if (solv->solution_callback) + if (solv->solution_callback) { solv->solution_callback(solv, solv->solution_callback_data); if (solv->branches.count) @@ -2536,7 +2555,7 @@ } /* auto-minimization step */ - if (solv->branches.count) + if (solv->branches.count) { int l = 0, lasti = -1, lastl = -1; Id why; @@ -3123,7 +3142,7 @@ map_empty(&solv->suggestsmap); solv->recommends_index = 0; } - solv->multiversionupdaters = solv_free(solv->multiversionupdaters); + solv->specialupdaters = solv_free(solv->specialupdaters); /* @@ -3411,7 +3430,7 @@ queue_push(&solv->orphaned, i); if (!r->p) { - assert(solv->dupmap_all && !sr->p); + /* assert(solv->dupmap_all && !sr->p); */ continue; } if (!solver_rulecmp(solv, r, sr)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.3/src/solver.h new/libsolv-0.4.4/src/solver.h --- old/libsolv-0.4.3/src/solver.h 2013-10-16 18:44:17.000000000 +0200 +++ new/libsolv-0.4.4/src/solver.h 2014-02-04 15:00:52.000000000 +0100 @@ -136,7 +136,7 @@ Id *obsoletes; /* obsoletes for each installed solvable */ Id *obsoletes_data; /* data area for obsoletes */ - Id *multiversionupdaters; /* updaters for multiversion packages in updatesystem mode */ + Id *specialupdaters; /* updaters for packages with a limited update rule */ /*------------------------------------------------------------------------------------------------------------- * Solver configuration diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.3/src/solver_private.h new/libsolv-0.4.4/src/solver_private.h --- old/libsolv-0.4.3/src/solver_private.h 2013-03-20 11:31:29.000000000 +0100 +++ new/libsolv-0.4.4/src/solver_private.h 2014-02-12 19:55:52.000000000 +0100 @@ -28,12 +28,18 @@ if (ISRELDEP(dep)) { Reldep *rd = GETRELDEP(pool, dep); - if (rd->flags == REL_AND) + if (rd->flags == REL_AND || rd->flags == REL_COND) { if (!solver_dep_fulfilled(solv, rd->name)) return 0; return solver_dep_fulfilled(solv, rd->evr); } + if (rd->flags == REL_OR) + { + if (solver_dep_fulfilled(solv, rd->name)) + return 1; + return solver_dep_fulfilled(solv, rd->evr); + } if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_SPLITPROVIDES) return solver_splitprovides(solv, rd->evr); if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_INSTALLED) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.3/tools/rpmdb2solv.c new/libsolv-0.4.4/tools/rpmdb2solv.c --- old/libsolv-0.4.3/tools/rpmdb2solv.c 2014-01-27 16:46:19.000000000 +0100 +++ new/libsolv-0.4.4/tools/rpmdb2solv.c 2014-01-28 13:45:51.000000000 +0100 @@ -163,7 +163,6 @@ pool_set_rootdir(pool, root); repo = repo_create(pool, "installed"); - pool_set_installed(pool, repo); data = repo_add_repodata(repo, 0); if (!nopacks) @@ -217,7 +216,7 @@ #ifdef SUSE if (add_auto) - repo_add_autopattern(repo, 0); + repo_add_autopattern(repo, ADD_NO_AUTOPRODUCTS); #endif tool_write(repo, basefile, 0); -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
