Hello community, here is the log from the commit of package libsolv for openSUSE:Factory checked in at 2014-02-28 16:25:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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-02-16 09:10:33.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.libsolv.new/libsolv.changes 2014-02-28 16:25:14.000000000 +0100 @@ -1,0 +2,17 @@ +Wed Feb 26 15:08:35 CET 2014 - [email protected] + +- improve appdata.xml parsing [bnc#865293] +- repo_helix: parse application elements +- bump version to 0.5.0 + +------------------------------------------------------------------- +Fri Feb 21 16:23:58 CET 2014 - [email protected] + +- fix bug in solver_get_unneeded that could lead to an + endless loop [bnc#828764] +- adapt to new rpm tags for weak dependencies +- fix pseudo packages obsoleting other pseudo packages +- optimize unfulfilled rule handling a bit +- bump version to 0.4.5 + +------------------------------------------------------------------- Old: ---- libsolv-0.4.4.tar.bz2 New: ---- libsolv-0.5.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libsolv.spec ++++++ --- /var/tmp/diff_new_pack.qUyx8u/_old 2014-02-28 16:25:14.000000000 +0100 +++ /var/tmp/diff_new_pack.qUyx8u/_new 2014-02-28 16:25:14.000000000 +0100 @@ -17,7 +17,7 @@ Name: libsolv -Version: 0.4.4 +Version: 0.5.0 Release: 0 Url: git://gitorious.org/opensuse/libsolv.git Source: libsolv-%{version}.tar.bz2 ++++++ libsolv-0.4.4.tar.bz2 -> libsolv-0.5.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.4/VERSION.cmake new/libsolv-0.5.0/VERSION.cmake --- old/libsolv-0.4.4/VERSION.cmake 2014-02-14 11:05:52.000000000 +0100 +++ new/libsolv-0.5.0/VERSION.cmake 2014-02-26 15:20:18.000000000 +0100 @@ -48,6 +48,6 @@ SET(LIBSOLVEXT_SOVERSION "0") SET(LIBSOLV_MAJOR "0") -SET(LIBSOLV_MINOR "4") -SET(LIBSOLV_PATCH "4") +SET(LIBSOLV_MINOR "5") +SET(LIBSOLV_PATCH "0") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.4/bindings/CMakeLists.txt new/libsolv-0.5.0/bindings/CMakeLists.txt --- old/libsolv-0.4.4/bindings/CMakeLists.txt 2013-10-04 11:23:38.000000000 +0200 +++ new/libsolv-0.5.0/bindings/CMakeLists.txt 2014-02-27 16:20:52.000000000 +0100 @@ -6,8 +6,15 @@ SET (SWIG_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/solv.i") IF (ENABLE_PYTHON) + IF (ENABLE_PYTHON3) + # build for both python and python3 + SET (PythonLibs_FIND_VERSION 2) + ENDIF (ENABLE_PYTHON3) ADD_SUBDIRECTORY (python) ENDIF (ENABLE_PYTHON) +IF (ENABLE_PYTHON3) + ADD_SUBDIRECTORY (python3) +ENDIF (ENABLE_PYTHON3) IF (ENABLE_PERL) ADD_SUBDIRECTORY (perl) ENDIF (ENABLE_PERL) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.4/bindings/solv.i new/libsolv-0.5.0/bindings/solv.i --- old/libsolv-0.4.4/bindings/solv.i 2014-01-09 13:30:53.000000000 +0100 +++ new/libsolv-0.5.0/bindings/solv.i 2014-02-27 16:20:52.000000000 +0100 @@ -1752,11 +1752,9 @@ } } #endif - #ifdef SWIGPERL perliter(solv::Dataiterator) #endif - %newobject __next__; Datamatch *__next__() { Dataiterator *ndi; @@ -1986,7 +1984,6 @@ } } #endif - #ifdef SWIGPERL perliter(solv::Pool_solvable_iterator) #endif @@ -2046,6 +2043,9 @@ } } #endif +#ifdef SWIGPERL + perliter(solv::Pool_repo_iterator) +#endif %newobject __next__; Repo *__next__() { Pool *pool = $self->pool; @@ -2103,6 +2103,9 @@ } } #endif +#ifdef SWIGPERL + perliter(solv::Repo_solvable_iterator) +#endif %newobject __next__; XSolvable *__next__() { Repo *repo = $self->repo; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.4/ext/repo_appdata.c new/libsolv-0.5.0/ext/repo_appdata.c --- old/libsolv-0.4.4/ext/repo_appdata.c 2013-10-09 13:21:32.000000000 +0200 +++ new/libsolv-0.5.0/ext/repo_appdata.c 2014-02-27 15:55:52.000000000 +0100 @@ -61,7 +61,7 @@ { STATE_START, "applications", STATE_START, 0 }, { STATE_START, "application", STATE_APPLICATION, 0 }, { STATE_APPLICATION, "id", STATE_ID, 1 }, - { STATE_APPLICATION, "licence", STATE_LICENCE, 1 }, + { STATE_APPLICATION, "product_license", STATE_LICENCE, 1 }, { STATE_APPLICATION, "name", STATE_NAME, 1 }, { STATE_APPLICATION, "summary", STATE_SUMMARY, 1 }, { STATE_APPLICATION, "description", STATE_DESCRIPTION, 0 }, @@ -95,6 +95,13 @@ char *description; int licnt; + int skip_tag; + int skip_tag_d; + int skip_tag_li; + + int flags; + char *desktop_file; + int havesummary; }; @@ -155,13 +162,38 @@ case STATE_APPLICATION: s = pd->solvable = pool_id2solvable(pool, repo_add_solvable(pd->repo)); pd->handle = s - pool->solvables; + pd->havesummary = 0; + break; + case STATE_NAME: + case STATE_SUMMARY: + pd->skip_tag = 0; + if (find_attr("xml:lang", atts)) + pd->skip_tag = 1; break; case STATE_DESCRIPTION: + pd->skip_tag_d = 0; + if (find_attr("xml:lang", atts)) + pd->skip_tag_d = 1; pd->description = solv_free(pd->description); break; case STATE_OL: + case STATE_UL: + pd->skip_tag = 0; + if (find_attr("xml:lang", atts)) + pd->skip_tag = 1; pd->licnt = 0; break; + case STATE_P: + pd->skip_tag = 0; + if (find_attr("xml:lang", atts)) + pd->skip_tag = 1; + break; + case STATE_UL_LI: + case STATE_OL_LI: + pd->skip_tag_li = 0; + if (find_attr("xml:lang", atts)) + pd->skip_tag_li = 1; + break; default: break; } @@ -216,6 +248,79 @@ } } +static void +add_missing_tags_from_desktop_file(struct parsedata *pd, Solvable *s, const char *desktop_file) +{ + Pool *pool = pd->pool; + FILE *fp; + const char *filepath; + char buf[1024]; + char *p, *p2, *p3; + int inde = 0; + + filepath = pool_tmpjoin(pool, "/usr/share/applications/", desktop_file, 0); + if (pd->flags & REPO_USE_ROOTDIR) + filepath = pool_prepend_rootdir_tmp(pool, filepath); + if (!(fp = fopen(filepath, "r"))) + return; + while (fgets(buf, sizeof(buf), fp) > 0) + { + int c, l = strlen(buf); + if (!l) + continue; + if (buf[l - 1] != '\n') + { + /* ignore overlong lines */ + while ((c = getc(fp)) != EOF) + if (c == '\n') + break; + if (c == EOF) + break; + continue; + } + buf[--l] = 0; + while (l && (buf[l - 1] == ' ' || buf[l - 1] == '\t')) + buf[--l] = 0; + p = buf; + while (*p == ' ' || *p == '\t') + p++; + if (!*p || *p == '#') + continue; + if (*p == '[') + inde = 0; + if (!strcmp(p, "[Desktop Entry]")) + { + inde = 1; + continue; + } + if (!inde) + continue; + p2 = strchr(p, '='); + if (!p2 || p2 == p) + continue; + *p2 = 0; + for (p3 = p2 - 1; *p3 == ' ' || *p3 == '\t'; p3--) + *p3 = 0; + p2++; + while (*p2 == ' ' || *p2 == '\t') + p2++; + if (!*p2) + continue; + if (!s->name && !strcmp(p, "Name")) + s->name = pool_str2id(pool, pool_tmpjoin(pool, "application:", p2, 0), 1); + else if (!pd->havesummary && !strcmp(p, "Comment")) + { + pd->havesummary = 1; + repodata_set_str(pd->data, pd->handle, SOLVABLE_SUMMARY, p2); + } + else + continue; + if (s->name && pd->havesummary) + break; /* our work is done */ + } + fclose(fp); +} + static void XMLCALL endElement(void *userData, const char *name) { @@ -246,25 +351,51 @@ s->arch = ARCH_NOARCH; if (!s->evr) s->evr = ID_EMPTY; + if ((!s->name || !pd->havesummary) && (pd->flags & APPDATA_CHECK_DESKTOP_FILE) != 0 && pd->desktop_file) + add_missing_tags_from_desktop_file(pd, s, pd->desktop_file); + if (!s->name && pd->desktop_file) + { + char *name = pool_tmpjoin(pool, "application:", pd->desktop_file, 0); + int l = strlen(name); + if (l > 8 && !strcmp(".desktop", name + l - 8)) + l -= 8; + s->name = pool_strn2id(pool, name, l, 1); + } 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); pd->solvable = 0; + pd->desktop_file = solv_free(pd->desktop_file); break; case STATE_ID: + pd->desktop_file = solv_strdup(pd->content); + /* guess the appdata.xml file name from the id element */ if (pd->lcontent > 8 && !strcmp(".desktop", pd->content + pd->lcontent - 8)) pd->content[pd->lcontent - 8] = 0; - id = pool_str2id(pd->pool, pool_tmpjoin(pool, "appdata(", pd->content, ")"), 1); + else if (pd->lcontent > 4 && !strcmp(".ttf", pd->content + pd->lcontent - 4)) + pd->content[pd->lcontent - 4] = 0; + else if (pd->lcontent > 4 && !strcmp(".otf", pd->content + pd->lcontent - 4)) + pd->content[pd->lcontent - 4] = 0; + else if (pd->lcontent > 4 && !strcmp(".xml", pd->content + pd->lcontent - 4)) + pd->content[pd->lcontent - 4] = 0; + else if (pd->lcontent > 3 && !strcmp(".db", pd->content + pd->lcontent - 3)) + pd->content[pd->lcontent - 3] = 0; + id = pool_str2id(pd->pool, pool_tmpjoin(pool, "appdata(", pd->content, ".appdata.xml)"), 1); s->requires = repo_addid_dep(pd->repo, s->requires, id, 0); - id = pool_str2id(pd->pool, pool_tmpjoin(pool, "application-appdata(", pd->content, ")"), 1); + id = pool_str2id(pd->pool, pool_tmpjoin(pool, "application-appdata(", pd->content, ".appdata.xml)"), 1); s->provides = repo_addid_dep(pd->repo, s->provides, id, 0); break; case STATE_NAME: + if (pd->skip_tag) + break; s->name = pool_str2id(pd->pool, pool_tmpjoin(pool, "application:", pd->content, 0), 1); break; case STATE_LICENCE: repodata_add_poolstr_array(pd->data, pd->handle, SOLVABLE_LICENSE, pd->content); break; case STATE_SUMMARY: + if (pd->skip_tag) + break; + pd->havesummary = 1; repodata_set_str(pd->data, pd->handle, SOLVABLE_SUMMARY, pd->content); break; case STATE_URL: @@ -274,7 +405,7 @@ repodata_add_poolstr_array(pd->data, pd->handle, SOLVABLE_GROUP, pd->content); break; case STATE_DESCRIPTION: - if (pd->description) + if (pd->description && !pd->skip_tag_d) { /* strip trailing newlines */ int l = strlen(pd->description); @@ -284,16 +415,22 @@ } break; case STATE_P: + if (pd->skip_tag) + break; wsstrip(pd); pd->description = solv_dupappend(pd->description, pd->content, "\n\n"); break; case STATE_UL_LI: + if (pd->skip_tag || pd->skip_tag_li) + break; wsstrip(pd); indent(pd, 4); pd->content[2] = '-'; pd->description = solv_dupappend(pd->description, pd->content, "\n"); break; case STATE_OL_LI: + if (pd->skip_tag || pd->skip_tag_li) + break; wsstrip(pd); indent(pd, 4); if (++pd->licnt >= 10) @@ -304,6 +441,8 @@ break; case STATE_UL: case STATE_OL: + if (pd->skip_tag) + break; pd->description = solv_dupappend(pd->description, "\n", 0); break; default: @@ -358,6 +497,7 @@ pd.repo = repo; pd.pool = repo->pool; pd.data = data; + pd.flags = flags; pd.content = malloc(256); pd.acontent = 256; @@ -391,7 +531,9 @@ if (!(flags & REPO_NO_INTERNALIZE)) repodata_internalize(data); - free(pd.content); + solv_free(pd.content); + solv_free(pd.desktop_file); + solv_free(pd.description); return ret; } @@ -427,10 +569,12 @@ pool_error(repo->pool, 0, "%s: %s", n, strerror(errno)); continue; } - repo_add_appdata(repo, fp, flags | REPO_NO_INTERNALIZE | REPO_REUSE_REPODATA); + repo_add_appdata(repo, fp, flags | REPO_NO_INTERNALIZE | REPO_REUSE_REPODATA | APPDATA_CHECK_DESKTOP_FILE); fclose(fp); } + closedir(dir); } + solv_free(dirpath); if (!(flags & REPO_NO_INTERNALIZE)) repodata_internalize(data); return 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.4/ext/repo_appdata.h new/libsolv-0.5.0/ext/repo_appdata.h --- old/libsolv-0.4.4/ext/repo_appdata.h 2013-10-09 13:21:32.000000000 +0200 +++ new/libsolv-0.5.0/ext/repo_appdata.h 2014-02-26 13:10:54.000000000 +0100 @@ -8,3 +8,4 @@ int repo_add_appdata(Repo *repo, FILE *fp, int flags); int repo_add_appdata_dir(Repo *repo, const char *appdatadir, int flags); +#define APPDATA_CHECK_DESKTOP_FILE (1 << 30) /* internal */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.4/ext/repo_helix.c new/libsolv-0.5.0/ext/repo_helix.c --- old/libsolv-0.4.4/ext/repo_helix.c 2013-12-13 15:02:48.000000000 +0100 +++ new/libsolv-0.5.0/ext/repo_helix.c 2014-02-25 11:40:52.000000000 +0100 @@ -100,6 +100,7 @@ { STATE_SUBCHANNEL, "atom", STATE_PACKAGE, 0 }, { STATE_SUBCHANNEL, "patch", STATE_PACKAGE, 0 }, { STATE_SUBCHANNEL, "product", STATE_PACKAGE, 0 }, + { STATE_SUBCHANNEL, "application", STATE_PACKAGE, 0 }, { STATE_PACKAGE, "name", STATE_NAME, 1 }, { STATE_PACKAGE, "vendor", STATE_VENDOR, 1 }, { STATE_PACKAGE, "buildtime", STATE_BUILDTIME, 1 }, @@ -461,6 +462,8 @@ pd->kind = "product"; else if (!strcmp(name, "patch")) pd->kind = "patch"; + else if (!strcmp(name, "application")) + pd->kind = "application"; else pd->kind = NULL; /* default is package */ pd->levrspace = 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.4/ext/repo_rpmdb.c new/libsolv-0.5.0/ext/repo_rpmdb.c --- old/libsolv-0.4.4/ext/repo_rpmdb.c 2014-01-22 17:15:52.000000000 +0100 +++ new/libsolv-0.5.0/ext/repo_rpmdb.c 2014-02-19 13:10:52.000000000 +0100 @@ -62,7 +62,7 @@ #define TAG_BUILDTIME 1006 #define TAG_BUILDHOST 1007 #define TAG_INSTALLTIME 1008 -#define TAG_SIZE 1009 +#define TAG_SIZE 1009 #define TAG_DISTRIBUTION 1010 #define TAG_VENDOR 1011 #define TAG_LICENSE 1014 @@ -103,14 +103,14 @@ #define TAG_BASENAMES 1117 #define TAG_DIRNAMES 1118 #define TAG_PAYLOADFORMAT 1124 -#define TAG_PATCHESNAME 1133 +#define TAG_PATCHESNAME 1133 #define TAG_FILECOLORS 1140 -#define TAG_SUGGESTSNAME 1156 -#define TAG_SUGGESTSVERSION 1157 -#define TAG_SUGGESTSFLAGS 1158 -#define TAG_ENHANCESNAME 1159 -#define TAG_ENHANCESVERSION 1160 -#define TAG_ENHANCESFLAGS 1161 +#define TAG_OLDSUGGESTSNAME 1156 +#define TAG_OLDSUGGESTSVERSION 1157 +#define TAG_OLDSUGGESTSFLAGS 1158 +#define TAG_OLDENHANCESNAME 1159 +#define TAG_OLDENHANCESVERSION 1160 +#define TAG_OLDENHANCESFLAGS 1161 /* rpm5 tags */ #define TAG_DISTEPOCH 1218 @@ -118,6 +118,18 @@ /* rpm4 tags */ #define TAG_LONGFILESIZES 5008 #define TAG_LONGSIZE 5009 +#define TAG_RECOMMENDNAME 5046 +#define TAG_RECOMMENDVERSION 5047 +#define TAG_RECOMMENDFLAGS 5048 +#define TAG_SUGGESTNAME 5049 +#define TAG_SUGGESTVERSION 5050 +#define TAG_SUGGESTFLAGS 5051 +#define TAG_SUPPLEMENTNAME 5052 +#define TAG_SUPPLEMENTVERSION 5053 +#define TAG_SUPPLEMENTFLAGS 5054 +#define TAG_ENHANCENAME 5055 +#define TAG_ENHANCEVERSION 5056 +#define TAG_ENHANCEFLAGS 5057 /* signature tags */ #define TAG_SIGBASE 256 @@ -140,9 +152,9 @@ #ifdef RPM5 -# define RPM_INDEX_SIZE 4 +# define RPM_INDEX_SIZE 4 /* just the rpmdbid */ #else -# define RPM_INDEX_SIZE 8 +# define RPM_INDEX_SIZE 8 /* rpmdbid + array index */ #endif @@ -393,10 +405,6 @@ } -#define MAKEDEPS_FILTER_WEAK (1 << 0) -#define MAKEDEPS_FILTER_STRONG (1 << 1) -#define MAKEDEPS_NO_RPMLIB (1 << 2) - /* * strong: 0: ignore strongness * 1: filter to strong @@ -411,10 +419,42 @@ int haspre, premask; unsigned int olddeps; Id *ida; - int strong; + int strong = 0; - strong = flags & (MAKEDEPS_FILTER_STRONG|MAKEDEPS_FILTER_WEAK); n = headstringarray(rpmhead, tagn, &nc); + if (!n) + { + switch (tagn) + { + case TAG_SUGGESTNAME: + tagn = TAG_OLDSUGGESTSNAME; + tagv = TAG_OLDSUGGESTSVERSION; + tagf = TAG_OLDSUGGESTSFLAGS; + strong = -1; + break; + case TAG_ENHANCENAME: + tagn = TAG_OLDENHANCESNAME; + tagv = TAG_OLDENHANCESVERSION; + tagf = TAG_OLDENHANCESFLAGS; + strong = -1; + break; + case TAG_RECOMMENDNAME: + tagn = TAG_OLDSUGGESTSNAME; + tagv = TAG_OLDSUGGESTSVERSION; + tagf = TAG_OLDSUGGESTSFLAGS; + strong = 1; + break; + case TAG_SUPPLEMENTNAME: + tagn = TAG_OLDENHANCESNAME; + tagv = TAG_OLDENHANCESVERSION; + tagf = TAG_OLDENHANCESFLAGS; + strong = 1; + break; + default: + return 0; + } + n = headstringarray(rpmhead, tagn, &nc); + } if (!n || !nc) return 0; vc = fc = 0; @@ -433,16 +473,16 @@ cc = nc; haspre = 0; /* add no prereq marker */ - premask = DEP_PRE_IN | DEP_PRE_UN; - if (flags) + premask = tagn == TAG_REQUIRENAME ? DEP_PRE_IN | DEP_PRE_UN : 0; + if ((flags & RPM_ADD_NO_RPMLIBREQS) || strong) { /* we do filtering */ cc = 0; for (i = 0; i < nc; i++) { - if (strong && (f[i] & DEP_STRONG) != (strong == MAKEDEPS_FILTER_WEAK ? 0 : DEP_STRONG)) + if (strong && (f[i] & DEP_STRONG) != (strong < 0 ? 0 : DEP_STRONG)) continue; - if ((flags & MAKEDEPS_NO_RPMLIB) != 0) + if ((flags & RPM_ADD_NO_RPMLIBREQS) != 0) if (!strncmp(n[i], "rpmlib(", 7)) continue; if ((f[i] & premask) != 0) @@ -450,7 +490,7 @@ cc++; } } - else if (tagn == TAG_REQUIRENAME) + else if (premask) { /* no filtering, just look for the first prereq */ for (i = 0; i < nc; i++) @@ -480,31 +520,34 @@ i = 0; *ida++ = SOLVABLE_PREREQMARKER; } - if (strong && (f[i] & DEP_STRONG) != (strong == MAKEDEPS_FILTER_WEAK ? 0 : DEP_STRONG)) - continue; - if (haspre == 1 && (f[i] & premask) != 0) + if (strong && (f[i] & DEP_STRONG) != (strong < 0 ? 0 : DEP_STRONG)) continue; - if (haspre == 2 && (f[i] & premask) == 0) - continue; - if ((flags & MAKEDEPS_NO_RPMLIB) != 0) + if (haspre) + { + if (haspre == 1 && (f[i] & premask) != 0) + continue; + if (haspre == 2 && (f[i] & premask) == 0) + continue; + } + if ((flags & RPM_ADD_NO_RPMLIBREQS) != 0) if (!strncmp(n[i], "rpmlib(", 7)) continue; if (f[i] & (DEP_LESS|DEP_GREATER|DEP_EQUAL)) { Id name, evr; - int flags = 0; + int fl = 0; if ((f[i] & DEP_LESS) != 0) - flags |= REL_LT; + fl |= REL_LT; if ((f[i] & DEP_EQUAL) != 0) - flags |= REL_EQ; + fl |= REL_EQ; if ((f[i] & DEP_GREATER) != 0) - flags |= REL_GT; + fl |= REL_GT; name = pool_str2id(pool, n[i], 1); if (v[i][0] == '0' && v[i][1] == ':' && v[i][2]) evr = pool_str2id(pool, v[i] + 2, 1); else evr = pool_str2id(pool, v[i], 1); - *ida++ = pool_rel2id(pool, name, evr, flags, 1); + *ida++ = pool_rel2id(pool, name, evr, fl, 1); } else *ida++ = pool_str2id(pool, n[i], 1); @@ -855,14 +898,15 @@ s->provides = makedeps(pool, repo, rpmhead, TAG_PROVIDENAME, TAG_PROVIDEVERSION, TAG_PROVIDEFLAGS, 0); if (s->arch != ARCH_SRC && s->arch != ARCH_NOSRC) s->provides = repo_addid_dep(repo, s->provides, pool_rel2id(pool, s->name, s->evr, REL_EQ, 1), 0); - s->requires = makedeps(pool, repo, rpmhead, TAG_REQUIRENAME, TAG_REQUIREVERSION, TAG_REQUIREFLAGS, (flags & RPM_ADD_NO_RPMLIBREQS) ? MAKEDEPS_NO_RPMLIB : 0); + s->requires = makedeps(pool, repo, rpmhead, TAG_REQUIRENAME, TAG_REQUIREVERSION, TAG_REQUIREFLAGS, flags); s->conflicts = makedeps(pool, repo, rpmhead, TAG_CONFLICTNAME, TAG_CONFLICTVERSION, TAG_CONFLICTFLAGS, 0); s->obsoletes = makedeps(pool, repo, rpmhead, TAG_OBSOLETENAME, TAG_OBSOLETEVERSION, TAG_OBSOLETEFLAGS, 0); - s->recommends = makedeps(pool, repo, rpmhead, TAG_SUGGESTSNAME, TAG_SUGGESTSVERSION, TAG_SUGGESTSFLAGS, MAKEDEPS_FILTER_STRONG); - s->suggests = makedeps(pool, repo, rpmhead, TAG_SUGGESTSNAME, TAG_SUGGESTSVERSION, TAG_SUGGESTSFLAGS, MAKEDEPS_FILTER_WEAK); - s->supplements = makedeps(pool, repo, rpmhead, TAG_ENHANCESNAME, TAG_ENHANCESVERSION, TAG_ENHANCESFLAGS, MAKEDEPS_FILTER_STRONG); - s->enhances = makedeps(pool, repo, rpmhead, TAG_ENHANCESNAME, TAG_ENHANCESVERSION, TAG_ENHANCESFLAGS, MAKEDEPS_FILTER_WEAK); + s->recommends = makedeps(pool, repo, rpmhead, TAG_RECOMMENDNAME, TAG_RECOMMENDVERSION, TAG_RECOMMENDFLAGS, 0); + s->suggests = makedeps(pool, repo, rpmhead, TAG_SUGGESTNAME, TAG_SUGGESTVERSION, TAG_SUGGESTFLAGS, 0); + s->supplements = makedeps(pool, repo, rpmhead, TAG_SUPPLEMENTNAME, TAG_SUPPLEMENTVERSION, TAG_SUPPLEMENTFLAGS, 0); + s->enhances = makedeps(pool, repo, rpmhead, TAG_ENHANCENAME, TAG_ENHANCEVERSION, TAG_ENHANCEFLAGS, 0); + s->supplements = repo_fix_supplements(repo, s->provides, s->supplements, 0); s->conflicts = repo_fix_conflicts(repo, s->conflicts); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.4/package/libsolv.changes new/libsolv-0.5.0/package/libsolv.changes --- old/libsolv-0.4.4/package/libsolv.changes 2014-02-14 11:05:52.000000000 +0100 +++ new/libsolv-0.5.0/package/libsolv.changes 2014-02-26 15:20:18.000000000 +0100 @@ -1,4 +1,21 @@ ------------------------------------------------------------------- +Wed Feb 26 15:08:35 CET 2014 - [email protected] + +- improve appdata.xml parsing [bnc#865293] +- repo_helix: parse application elements +- bump version to 0.5.0 + +------------------------------------------------------------------- +Fri Feb 21 16:23:58 CET 2014 - [email protected] + +- fix bug in solver_get_unneeded that could lead to an + endless loop [bnc#828764] +- adapt to new rpm tags for weak dependencies +- fix pseudo packages obsoleting other pseudo packages +- optimize unfulfilled rule handling a bit +- bump version to 0.4.5 + +------------------------------------------------------------------- Fri Feb 14 11:03:18 CET 2014 - [email protected] - always keep job/jobflags in selection_filter() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.4/src/pool.c new/libsolv-0.5.0/src/pool.c --- old/libsolv-0.4.4/src/pool.c 2014-01-20 11:30:52.000000000 +0100 +++ new/libsolv-0.5.0/src/pool.c 2014-02-18 13:10:52.000000000 +0100 @@ -880,6 +880,10 @@ * * add packages fulfilling the relation to whatprovides array * + * some words about REL_AND and REL_IF: we assume the best case + * here, so that you get a "potential" result if you ask for a match. + * E.g. if you ask for "whatrequires A" and package X contains + * "Requires: A & B", you'll get "X" as an answer. */ Id pool_addrelproviders(Pool *pool, Id d) @@ -909,7 +913,6 @@ switch (flags) { - case REL_AND: case REL_WITH: wp = pool_whatprovides(pool, name); pp2 = pool_whatprovides_ptr(pool, evr); @@ -925,24 +928,43 @@ wp = 0; } break; + + case REL_AND: case REL_OR: wp = pool_whatprovides(pool, name); - pp = pool->whatprovidesdata + wp; - if (!*pp) + if (!pool->whatprovidesdata[wp]) wp = pool_whatprovides(pool, evr); else { - int cnt; - while ((p = *pp++) != 0) - queue_push(&plist, p); - cnt = plist.count; - pp = pool_whatprovides_ptr(pool, evr); - while ((p = *pp++) != 0) - queue_pushunique(&plist, p); - if (plist.count != cnt) + /* sorted merge */ + pp2 = pool_whatprovides_ptr(pool, evr); + pp = pool->whatprovidesdata + wp; + while (*pp && *pp2) + { + if (*pp < *pp2) + queue_push(&plist, *pp++); + else + { + if (*pp == *pp2) + pp++; + queue_push(&plist, *pp2++); + } + } + while (*pp) + queue_push(&plist, *pp++); + while (*pp2) + queue_push(&plist, *pp2++); + /* if the number of elements did not change, we can reuse wp */ + if (pp - (pool->whatprovidesdata + wp) != plist.count) wp = 0; } break; + + case REL_COND: + /* assume the condition is true */ + wp = pool_whatprovides(pool, name); + break; + case REL_NAMESPACE: if (name == NAMESPACE_OTHERPROVIDERS) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.4/src/rules.c new/libsolv-0.5.0/src/rules.c --- old/libsolv-0.4.4/src/rules.c 2014-02-12 19:55:52.000000000 +0100 +++ new/libsolv-0.5.0/src/rules.c 2014-02-21 15:15:53.000000000 +0100 @@ -3905,8 +3905,8 @@ /* now add edge from j + 1 to i + 1 */ queue_insert(&edges, edges.elements[j + 1] + nrequires[j], i + 1); /* addapt following edge pointers */ - for (k = j + 2; k < count + 2; k++) - edges.elements[k]++; + for (j = j + 2; j < count + 1; j++) + edges.elements[j]++; } queue_free(&iq); } @@ -3921,7 +3921,7 @@ printf(" %s (%d requires):\n", pool_solvid2str(pool, unneededq->elements[i]), nrequires[i]); for (j = edges.elements[i + 1]; edges.elements[j]; j++) printf(" - %s\n", pool_solvid2str(pool, unneededq->elements[edges.elements[j] - 1])); - } + } #endif map_free(&installedm); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.4/src/solver.c new/libsolv-0.5.0/src/solver.c --- old/libsolv-0.4.4/src/solver.c 2014-02-04 15:00:52.000000000 +0100 +++ new/libsolv-0.5.0/src/solver.c 2014-02-17 13:25:52.000000000 +0100 @@ -2063,12 +2063,18 @@ r = solv->rules + i; if (r->d < 0) /* ignore disabled rules */ continue; - queue_empty(&dq); + if (r->p < 0) /* most common cases first */ + { + if (r->d == 0 || solv->decisionmap[-r->p] <= 0) + continue; + } + if (dq.count) + queue_empty(&dq); if (r->d == 0) { /* binary or unary rule */ - /* need two positive undecided literals */ - if (r->p < 0 || r->w2 <= 0) + /* need two positive undecided literals, r->p already checked above */ + if (r->w2 <= 0) continue; if (solv->decisionmap[r->p] || solv->decisionmap[r->w2]) continue; @@ -2082,13 +2088,9 @@ * no positive literal is installed * i.e. the rule is not fulfilled and we * just need to decide on the positive literals + * (decisionmap[-r->p] for the r->p < 0 case is already checked above) */ - if (r->p < 0) - { - if (solv->decisionmap[-r->p] <= 0) - continue; - } - else + if (r->p >= 0) { if (solv->decisionmap[r->p] > 0) continue; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.4/src/transaction.c new/libsolv-0.5.0/src/transaction.c --- old/libsolv-0.4.4/src/transaction.c 2013-10-24 14:51:42.000000000 +0200 +++ new/libsolv-0.5.0/src/transaction.c 2014-02-18 15:49:30.000000000 +0100 @@ -291,13 +291,15 @@ if ((mode & SOLVER_TRANSACTION_RPM_ONLY) != 0) { - /* application wants to know what to feed to rpm */ + /* application wants to know what to feed to the package manager */ + if (!(mode & SOLVER_TRANSACTION_KEEP_PSEUDO) && is_pseudo_package(pool, s)) + return SOLVER_TRANSACTION_IGNORE; if (type == SOLVER_TRANSACTION_ERASE || type == SOLVER_TRANSACTION_INSTALL || type == SOLVER_TRANSACTION_MULTIINSTALL) return type; if (s->repo == pool->installed) { - /* check if we're obsoleted by pseudos only */ - if (obsoleted_by_pseudos_only(trans, s - pool->solvables)) + /* check if we're a real package that is obsoleted by pseudos */ + if (!is_pseudo_package(pool, s) && obsoleted_by_pseudos_only(trans, s - pool->solvables)) return SOLVER_TRANSACTION_ERASE; return SOLVER_TRANSACTION_IGNORE; /* ignore as we're being obsoleted */ } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.4.4/tools/appdata2solv.c new/libsolv-0.5.0/tools/appdata2solv.c --- old/libsolv-0.4.4/tools/appdata2solv.c 2013-12-09 14:31:42.000000000 +0100 +++ new/libsolv-0.5.0/tools/appdata2solv.c 2014-02-26 13:10:54.000000000 +0100 @@ -20,6 +20,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <unistd.h> #include "pool.h" #include "repo.h" @@ -30,11 +31,46 @@ main(int argc, char **argv) { Pool *pool = pool_create(); - Repo *repo = repo_create(pool, "<stdin>"); - if (repo_add_appdata(repo, stdin, 0)) + Repo *repo; + int c; + const char *appdatadir = 0; + const char *root = 0; + + while ((c = getopt(argc, argv, "hd:r:")) >= 0) + { + switch (c) + { + case 'd': + appdatadir = optarg; + break; + case 'r': + root = optarg; + break; + default: + fprintf(stderr, "usage: appdata2solv [-d appdatadir]"); + exit(c == 'h' ? 0 : 1); + } + } + + if (root) + pool_set_rootdir(pool, root); + + repo = repo_create(pool, "<stdin>"); + if (!appdatadir) + { + if (repo_add_appdata(repo, stdin, 0)) + { + fprintf(stderr, "appdata2solv: %s\n", pool_errstr(pool)); + exit(1); + } + } + else { - fprintf(stderr, "appdata2solv: %s\n", pool_errstr(pool)); - exit(1); + if (repo_add_appdata_dir(repo, appdatadir, REPO_USE_ROOTDIR)) + { + fprintf(stderr, "appdata2solv: %s\n", pool_errstr(pool)); + exit(1); + } } tool_write(repo, 0, 0); pool_free(pool); -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
