Hello community, here is the log from the commit of package libsolv for openSUSE:Factory checked in at 2016-06-05 14:17:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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 2016-04-30 23:29:01.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.libsolv.new/libsolv.changes 2016-06-05 14:17:22.000000000 +0200 @@ -1,0 +2,15 @@ +Wed May 18 15:09:56 CEST 2016 - mls@suse.de + +- add pool->setdisttype to the bindings +- fix error in repo_deb that could lead to missing packages +- add reason testing to testcase code +- add pool_whatcontainsdep, selection_make_matchdepid, and + SELECTION_MATCH_DEPSTR +- add SOLVER_FAVOR and SOLVER_DISFAVOR job types +- allow unknown archs in pool_setarch +- add the SOLVER_FLAG_URPM_REORDER solver flag +- fix segfault in cshash dedup code [bnc#980901] +- fix supplements handling when implicitobsoleteusescolors is set +- bump version to 0.6.21 + +------------------------------------------------------------------- Old: ---- libsolv-0.6.20.tar.bz2 New: ---- libsolv-0.6.21.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libsolv.spec ++++++ --- /var/tmp/diff_new_pack.Uxuod3/_old 2016-06-05 14:17:23.000000000 +0200 +++ /var/tmp/diff_new_pack.Uxuod3/_new 2016-06-05 14:17:23.000000000 +0200 @@ -17,7 +17,7 @@ Name: libsolv -Version: 0.6.20 +Version: 0.6.21 Release: 0 Url: https://github.com/openSUSE/libsolv Source: libsolv-%{version}.tar.bz2 ++++++ libsolv-0.6.20.tar.bz2 -> libsolv-0.6.21.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.20/CMakeLists.txt new/libsolv-0.6.21/CMakeLists.txt --- old/libsolv-0.6.20/CMakeLists.txt 2016-02-11 17:01:33.000000000 +0100 +++ new/libsolv-0.6.21/CMakeLists.txt 2016-05-18 15:01:17.000000000 +0200 @@ -57,10 +57,10 @@ ENDIF (DEFINED INCLUDE) MESSAGE (STATUS "Header files will be installed in ${INCLUDE_INSTALL_DIR}") SET (BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin") -SET (MAN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/man") -IF (IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/share/man" AND NOT IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/man") - SET (MAN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/man") -ENDIF (IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/share/man" AND NOT IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/man") +SET (MAN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/man") +IF (IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/man" AND NOT IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/share/man") + SET (MAN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/man") +ENDIF (IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/man" AND NOT IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/share/man") MESSAGE(STATUS "Man pages will be installed in ${MAN_INSTALL_DIR}") #################################################################### diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.20/VERSION.cmake new/libsolv-0.6.21/VERSION.cmake --- old/libsolv-0.6.20/VERSION.cmake 2016-04-08 15:50:47.000000000 +0200 +++ new/libsolv-0.6.21/VERSION.cmake 2016-05-18 15:16:10.000000000 +0200 @@ -49,5 +49,5 @@ SET(LIBSOLV_MAJOR "0") SET(LIBSOLV_MINOR "6") -SET(LIBSOLV_PATCH "20") +SET(LIBSOLV_PATCH "21") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.20/bindings/solv.i new/libsolv-0.6.21/bindings/solv.i --- old/libsolv-0.6.20/bindings/solv.i 2016-04-21 12:11:30.000000000 +0200 +++ new/libsolv-0.6.21/bindings/solv.i 2016-05-03 16:26:06.000000000 +0200 @@ -1172,6 +1172,8 @@ static const Id SOLVER_DROP_ORPHANED = SOLVER_DROP_ORPHANED; static const Id SOLVER_USERINSTALLED = SOLVER_USERINSTALLED; static const Id SOLVER_ALLOWUNINSTALL = SOLVER_ALLOWUNINSTALL; + static const Id SOLVER_FAVOR = SOLVER_FAVOR; + static const Id SOLVER_DISFAVOR = SOLVER_DISFAVOR; static const Id SOLVER_JOBMASK = SOLVER_JOBMASK; static const Id SOLVER_WEAK = SOLVER_WEAK; static const Id SOLVER_ESSENTIAL = SOLVER_ESSENTIAL; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.20/doc/libsolv-bindings.3 new/libsolv-0.6.21/doc/libsolv-bindings.3 --- old/libsolv-0.6.20/doc/libsolv-bindings.3 2016-02-11 17:01:33.000000000 +0100 +++ new/libsolv-0.6.21/doc/libsolv-bindings.3 2016-05-03 16:26:06.000000000 +0200 @@ -1,13 +1,13 @@ '\" t .\" Title: Libsolv-Bindings .\" Author: [see the "Author" section] -.\" Generator: DocBook XSL Stylesheets v1.78.0 http://docbook.sf.net/ -.\" Date: 12/14/2015 +.\" Generator: DocBook XSL Stylesheets v1.78.1 http://docbook.sf.net/ +.\" Date: 05/03/2016 .\" Manual: LIBSOLV .\" Source: libsolv .\" Language: English .\" -.TH "LIBSOLV\-BINDINGS" "3" "12/14/2015" "libsolv" "LIBSOLV" +.TH "LIBSOLV\-BINDINGS" "3" "05/03/2016" "libsolv" "LIBSOLV" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -3256,6 +3256,16 @@ Allow the solver to deinstall the matching installed packages if they get into the way of resolving a dependency\&. This is like the SOLVER_FLAG_ALLOW_UNINSTALL flag, but limited to a specific set of packages\&. .RE .PP +\fBSOLVER_FAVOR\fR +.RS 4 +Prefer the specified packages if the solver encounters an alternative\&. If a job contains multiple matching favor/disfavor elements, the last one takes precedence\&. +.RE +.PP +\fBSOLVER_DISFAVOR\fR +.RS 4 +Avoid the specified packages if the solver encounters an alternative\&. This can also be used to block recommended or supplemented packages from being installed\&. +.RE +.PP \fBSOLVER_JOBMASK\fR .RS 4 A mask containing all the above action bits\&. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.20/doc/libsolv-bindings.txt new/libsolv-0.6.21/doc/libsolv-bindings.txt --- old/libsolv-0.6.20/doc/libsolv-bindings.txt 2016-02-11 17:01:33.000000000 +0100 +++ new/libsolv-0.6.21/doc/libsolv-bindings.txt 2016-05-03 16:26:06.000000000 +0200 @@ -1878,6 +1878,16 @@ into the way of resolving a dependency. This is like the SOLVER_FLAG_ALLOW_UNINSTALL flag, but limited to a specific set of packages. +*SOLVER_FAVOR*:: +Prefer the specified packages if the solver encounters an alternative. If +a job contains multiple matching favor/disfavor elements, the last one takes +precedence. + +*SOLVER_DISFAVOR*:: +Avoid the specified packages if the solver encounters an alternative. This +can also be used to block recommended or supplemented packages from being +installed. + *SOLVER_JOBMASK*:: A mask containing all the above action bits. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.20/doc/libsolv-pool.3 new/libsolv-0.6.21/doc/libsolv-pool.3 --- old/libsolv-0.6.20/doc/libsolv-pool.3 2016-02-11 17:01:33.000000000 +0100 +++ new/libsolv-0.6.21/doc/libsolv-pool.3 2016-05-06 12:11:13.000000000 +0200 @@ -1,13 +1,13 @@ '\" t .\" Title: Libsolv-Pool .\" Author: [see the "Author" section] -.\" Generator: DocBook XSL Stylesheets v1.78.0 http://docbook.sf.net/ -.\" Date: 12/14/2015 +.\" Generator: DocBook XSL Stylesheets v1.78.1 http://docbook.sf.net/ +.\" Date: 05/06/2016 .\" Manual: LIBSOLV .\" Source: libsolv .\" Language: English .\" -.TH "LIBSOLV\-POOL" "3" "12/14/2015" "libsolv" "LIBSOLV" +.TH "LIBSOLV\-POOL" "3" "05/06/2016" "libsolv" "LIBSOLV" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -369,7 +369,7 @@ .RE .\} .sp -Set the package type of your system\&. The disttype is used for example to define package comparison semantics\&. Libsolv\(cqs default disttype should match the package manager of your system, so you only need to use this function if you want to use the library to solve packaging problems for different systems\&. The Function returns the old disttype on success, and \-1 if the new disttype is not supported\&. +Set the package type of your system\&. The disttype is used for example to define package comparison semantics\&. Libsolv\(cqs default disttype should match the package manager of your system, so you only need to use this function if you want to use the library to solve packaging problems for different systems\&. The Function returns the old disttype on success, and \-1 if the new disttype is not supported\&. Note that any pool_setarch and pool_setarchpolicy calls need to come after the pool_setdisttype call, as they make use of the noarch/any/all architecture id\&. .sp .if n \{\ .RS 4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.20/doc/libsolv-pool.txt new/libsolv-0.6.21/doc/libsolv-pool.txt --- old/libsolv-0.6.20/doc/libsolv-pool.txt 2016-02-11 17:01:33.000000000 +0100 +++ new/libsolv-0.6.21/doc/libsolv-pool.txt 2016-05-06 12:11:13.000000000 +0200 @@ -270,6 +270,9 @@ use this function if you want to use the library to solve packaging problems for different systems. The Function returns the old disttype on success, and -1 if the new disttype is not supported. +Note that any pool_setarch and pool_setarchpolicy calls need to +come after the pool_setdisttype call, as they make use of the +noarch/any/all architecture id. int pool_set_flag(Pool *pool, int flag, int value); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.20/examples/solv/solv.c new/libsolv-0.6.21/examples/solv/solv.c --- old/libsolv-0.6.20/examples/solv/solv.c 2016-04-22 15:41:30.000000000 +0200 +++ new/libsolv-0.6.21/examples/solv/solv.c 2016-05-20 15:26:11.000000000 +0200 @@ -67,7 +67,7 @@ int -yesno(const char *str) +yesno(const char *str, int other) { char inbuf[128], *ip; @@ -88,8 +88,8 @@ printf("Abort.\n"); exit(1); } - if (*ip == 'y' || *ip == 'n') - return *ip == 'y' ? 1 : 0; + if (*ip == 'y' || *ip == 'n' || *ip == other) + return *ip == 'n' ? 0 : *ip; } } @@ -238,6 +238,7 @@ char *keyname = 0; int keyname_depstr = 0; int debuglevel = 0; + int answer, acnt = 0; argc--; argv++; @@ -672,9 +673,7 @@ queue_push2(&job, SOLVER_ERASE|SOLVER_CLEANDEPS|SOLVER_SOLVABLE_PROVIDES, pool_rel2id(pool, NAMESPACE_LANGUAGE, 0, REL_NAMESPACE, 1)); #endif -#if defined(ENABLE_RPMDB) && (defined(SUSE) || defined(FEDORA) || defined(MANDRIVA) || defined(MAGEIA)) rerunsolver: -#endif solv = solver_create(pool); solver_set_flag(solv, SOLVER_FLAG_SPLITPROVIDES, 1); #ifdef FEDORA @@ -765,7 +764,90 @@ printf("install size change: %d K\n", transaction_calc_installsizechange(trans)); printf("\n"); - if (!yesno("OK to continue (y/n)? ")) + acnt = solver_alternatives_count(solv); + if (acnt) + { + if (acnt == 1) + printf("Have one alternative:\n"); + else + printf("Have %d alternatives:\n", acnt); + for (i = 1; i <= acnt; i++) + { + Id id, from; + int atype = solver_get_alternative(solv, i, &id, &from, 0, 0, 0); + printf(" - %s\n", solver_alternative2str(solv, atype, id, from)); + } + printf("\n"); + answer = yesno("OK to continue (y/n/a)? ", 'a'); + } + else + answer = yesno("OK to continue (y/n)? ", 0); + if (answer == 'a') + { + Queue choicesq; + Queue answerq; + Id id, from, chosen; + int j; + + queue_init(&choicesq); + queue_init(&answerq); + for (i = 1; i <= acnt; i++) + { + int atype = solver_get_alternative(solv, i, &id, &from, &chosen, &choicesq, 0); + printf("\n%s\n", solver_alternative2str(solv, atype, id, from)); + for (j = 0; j < choicesq.count; j++) + { + Id p = choicesq.elements[j]; + if (p < 0) + p = -p; + queue_push(&answerq, p); + printf("%6d: %s\n", answerq.count, pool_solvid2str(pool, p)); + } + } + queue_free(&choicesq); + printf("\n"); + for (;;) + { + char inbuf[128], *ip; + int neg = 0; + printf("OK to continue (y/n), or number to change alternative: "); + fflush(stdout); + *inbuf = 0; + if (!(ip = fgets(inbuf, sizeof(inbuf), stdin))) + { + printf("Abort.\n"); + exit(1); + } + while (*ip == ' ' || *ip == '\t') + ip++; + if (*ip == '-' && ip[1] >= '0' && ip[1] <= '9') + { + neg = 1; + ip++; + } + if (*ip >= '0' && *ip <= '9') + { + int take = atoi(ip); + if (take > 0 && take <= answerq.count) + { + Id p = answerq.elements[take - 1]; + queue_free(&answerq); + queue_push2(&job, (neg ? SOLVER_DISFAVOR : SOLVER_FAVOR) | SOLVER_SOLVABLE_NAME, pool->solvables[p].name); + solver_free(solv); + solv = 0; + goto rerunsolver; + break; + } + } + if (*ip == 'n' || *ip == 'y') + { + answer = *ip == 'n' ? 0 : *ip; + break; + } + } + queue_free(&answerq); + } + if (!answer) { printf("Abort.\n"); transaction_free(trans); @@ -854,7 +936,7 @@ queue_init(&conflicts); if (checkfileconflicts(pool, &checkq, newpkgs, newpkgsfps, &conflicts)) { - if (yesno("Re-run solver (y/n/q)? ")) + if (yesno("Re-run solver (y/n/q)? ", 0)) { for (i = 0; i < newpkgs; i++) if (newpkgsfps[i]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.20/ext/pool_fileconflicts.c new/libsolv-0.6.21/ext/pool_fileconflicts.c --- old/libsolv-0.6.20/ext/pool_fileconflicts.c 2016-02-11 17:01:33.000000000 +0100 +++ new/libsolv-0.6.21/ext/pool_fileconflicts.c 2016-05-06 14:16:01.000000000 +0200 @@ -640,7 +640,7 @@ strncpy(md5padded, info->digest, 32); md5padded[32] = 0; md5padded[33] = info->color; - /* printf("%d, hx %x -> %s %d %s\n", cbdata->idx, hx, fn, info->mode, info->digest); */ + /* printf("%d, hx %x -> %s %d %s %d\n", cbdata->idx, hx, fn, info->mode, info->digest, info->color); */ off = addfilesspace(cbdata, strlen(fn) + (34 + 1)); memcpy(cbdata->filesspace + off, (unsigned char *)md5padded, 34); strcpy((char *)cbdata->filesspace + off + 34, fn); @@ -805,7 +805,7 @@ void *handle; Repo *installed = pool->installed; Id p; - int obsoleteusescolors = pool_get_flag(pool, POOL_FLAG_OBSOLETEUSESCOLORS); + int usefilecolors; int hdrfetches; queue_empty(conflicts); @@ -813,8 +813,10 @@ return 0; now = start = solv_timems(0); + /* Hmm, should we have a different flag for this? */ + usefilecolors = pool_get_flag(pool, POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS); POOL_DEBUG(SOLV_DEBUG_STATS, "searching for file conflicts\n"); - POOL_DEBUG(SOLV_DEBUG_STATS, "packages: %d, cutoff %d\n", pkgs->count, cutoff); + POOL_DEBUG(SOLV_DEBUG_STATS, "packages: %d, cutoff %d, usefilecolors %d\n", pkgs->count, cutoff, usefilecolors); memset(&cbdata, 0, sizeof(cbdata)); cbdata.aliases = flags & FINDFILECONFLICTS_CHECK_DIRALIASING; @@ -1026,7 +1028,7 @@ { Id idx = cbdata.lookat.elements[i + 1]; int iterflags = RPM_ITERATE_FILELIST_WITHMD5 | RPM_ITERATE_FILELIST_NOGHOSTS; - if (obsoleteusescolors) + if (usefilecolors) iterflags |= RPM_ITERATE_FILELIST_WITHCOL; p = pkgs->elements[idx]; handle = (*handle_cb)(pool, p, handle_cbdata); @@ -1098,7 +1100,7 @@ } if (!strcmp(fsi, fsj)) continue; /* file digests match, no conflict */ - if (obsoleteusescolors && fsi[33] && fsj[33] && (fsi[33] & fsj[33]) == 0) + if (usefilecolors && fsi[33] && fsj[33] && (fsi[33] & fsj[33]) == 0) continue; /* colors do not conflict */ queue_push(conflicts, pool_str2id(pool, fsi + 34, 1)); queue_push(conflicts, pkgs->elements[pidx]); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.20/ext/repo_rpmdb.c new/libsolv-0.6.21/ext/repo_rpmdb.c --- old/libsolv-0.6.20/ext/repo_rpmdb.c 2016-04-09 13:25:47.000000000 +0200 +++ new/libsolv-0.6.21/ext/repo_rpmdb.c 2016-05-06 14:16:01.000000000 +0200 @@ -2435,7 +2435,7 @@ if ((flags & RPM_ITERATE_FILELIST_WITHCOL) != 0) { co = headint32array(rpmhead, TAG_FILECOLORS, &cnt2); - if (!co || cnt != cnt2) + if (co && cnt != cnt2) { solv_free(co); solv_free(md); @@ -2513,8 +2513,7 @@ info.digest = md5; } } - if (co) - info.color = co[i]; + info.color = co ? co[i] : 0; (*cb)(cbdata, space, &info); } solv_free(space); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.20/ext/repo_rpmmd.c new/libsolv-0.6.21/ext/repo_rpmmd.c --- old/libsolv-0.6.20/ext/repo_rpmmd.c 2016-03-03 13:00:45.000000000 +0100 +++ new/libsolv-0.6.21/ext/repo_rpmmd.c 2016-05-17 11:31:53.000000000 +0200 @@ -651,13 +651,13 @@ while (ht[h]) { unsigned char *d = pd->csdata + ht[h]; - if (d[-1] == keyl && !memcmp(key, d, keyl)) + if (d[-1] == keyl - 1 && !memcmp(key, d, keyl)) return; /* XXX: first id wins... */ h = HASHCHAIN_NEXT(h, hh, hm); } } /* a new entry. put in csdata */ - pd->csdata = solv_extend(pd->csdata, pd->ncsdata, 1, 1 + keyl + sizeof(Id), 4095); + pd->csdata = solv_extend(pd->csdata, pd->ncsdata, 1 + keyl + sizeof(Id), 1, 4095); d = pd->csdata + pd->ncsdata; d[0] = keyl - 1; memcpy(d + 1, key, keyl); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.20/ext/testcase.c new/libsolv-0.6.21/ext/testcase.c --- old/libsolv-0.6.20/ext/testcase.c 2016-04-20 13:11:28.000000000 +0200 +++ new/libsolv-0.6.21/ext/testcase.c 2016-05-13 15:06:01.000000000 +0200 @@ -46,6 +46,8 @@ { SOLVER_DROP_ORPHANED, "droporphaned" }, { SOLVER_USERINSTALLED, "userinstalled" }, { SOLVER_ALLOWUNINSTALL, "allowuninstall" }, + { SOLVER_FAVOR, "favor" }, + { SOLVER_DISFAVOR, "disfavor" }, { 0, 0 } }; @@ -112,6 +114,7 @@ { SOLVER_FLAG_FOCUS_INSTALLED, "focusinstalled", 0 }, { SOLVER_FLAG_YUM_OBSOLETES, "yumobsoletes", 0 }, { SOLVER_FLAG_NEED_UPDATEPROVIDE, "needupdateprovide", 0 }, + { SOLVER_FLAG_URPM_REORDER, "urpmreorder", 0 }, { 0, 0, 0 } }; @@ -1554,7 +1557,11 @@ pool_debug(solv->pool, SOLV_ERROR, "setsolverflags: unknown flag '%.*s'\n", (int)(p - s), s); return 0; } - solver_set_flag(solv, solverflags2str[i].flag, v); + if (solver_set_flag(solv, solverflags2str[i].flag, v) == -1) + { + pool_debug(solv->pool, SOLV_ERROR, "setsolverflags: unsupported flag '%s'\n", solverflags2str[i].str); + return 0; + } } return 1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.20/package/libsolv.changes new/libsolv-0.6.21/package/libsolv.changes --- old/libsolv-0.6.20/package/libsolv.changes 2016-04-08 15:50:47.000000000 +0200 +++ new/libsolv-0.6.21/package/libsolv.changes 2016-05-20 15:26:11.000000000 +0200 @@ -1,4 +1,19 @@ ------------------------------------------------------------------- +Wed May 18 15:09:56 CEST 2016 - mls@suse.de + +- add pool->setdisttype to the bindings +- fix error in repo_deb that could lead to missing packages +- add reason testing to testcase code +- add pool_whatcontainsdep, selection_make_matchdepid, and + SELECTION_MATCH_DEPSTR +- add SOLVER_FAVOR and SOLVER_DISFAVOR job types +- allow unknown archs in pool_setarch +- add the SOLVER_FLAG_URPM_REORDER solver flag +- fix segfault in cshash dedup code [bnc#980901] +- fix supplements handling when implicitobsoleteusescolors is set +- bump version to 0.6.21 + +------------------------------------------------------------------- Fri Apr 8 15:36:21 CEST 2016 - mls@suse.de - Better support of complex deps in pool_match_dep and diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.20/src/policy.c new/libsolv-0.6.21/src/policy.c --- old/libsolv-0.6.20/src/policy.c 2016-02-11 17:01:33.000000000 +0100 +++ new/libsolv-0.6.21/src/policy.c 2016-05-18 14:51:00.000000000 +0200 @@ -453,6 +453,89 @@ } } +static int +sort_by_favorq_cmp(const void *ap, const void *bp, void *dp) +{ + const Id *a = ap, *b = bp, *d = dp; + return d[b[0]] - d[a[0]]; +} + +static void +sort_by_favorq(Queue *favorq, Id *el, int cnt) +{ + int i; + /* map to offsets into favorq */ + for (i = 0; i < cnt; i++) + { + Id p = el[i]; + /* lookup p in sorted favorq */ + int med = 0, low = 0; + int high = favorq->count / 2; + while (low != high) + { + med = (low + high) / 2; + Id pp = favorq->elements[2 * med]; + if (pp < p) + low = med; + else if (pp > p) + high = med; + else + break; + } + while(med && favorq->elements[2 * med - 2] == p) + med--; + if (favorq->elements[2 * med] == p) + el[i] = 2 * med + 1; + else + el[i] = 0; /* hmm */ + } + /* sort by position */ + solv_sort(el, cnt, sizeof(Id), sort_by_favorq_cmp, favorq->elements); + /* map back */ + for (i = 0; i < cnt; i++) + if (el[i]) + el[i] = favorq->elements[el[i] - 1]; +} + +/* bring favored packages to front and disfavored packages to back */ +void +policy_prefer_favored(Solver *solv, Queue *plist) +{ + int i, fav, disfav, count; + if (!solv->favormap.size) + return; + for (i = fav = disfav = 0, count = plist->count; i < count; i++) + { + Id p = plist->elements[i]; + if (!MAPTST(&solv->favormap, p)) + continue; + if (solv->isdisfavormap.size && MAPTST(&solv->isdisfavormap, p)) + { + /* disfavored package. bring to back */ + if (i < plist->count - 1) + { + memmove(plist->elements + i, plist->elements + i + 1, (plist->count - 1 - i) * sizeof(Id)); + plist->elements[plist->count - 1] = p; + } + i--; + count--; + disfav++; + } + else + { + /* favored package. bring to front */ + if (i > fav) + memmove(plist->elements + fav + 1, plist->elements + fav, (i - fav) * sizeof(Id)); + plist->elements[fav++] = p; + } + } + /* if we have multiple favored/disfavored packages, sort by favorq index */ + if (fav > 1) + sort_by_favorq(solv->favorq, plist->elements, fav); + if (disfav > 1) + sort_by_favorq(solv->favorq, plist->elements + plist->count - disfav, disfav); +} + /* * prune to recommended/suggested packages. * does not prune installed packages (they are also somewhat recommended). @@ -1112,6 +1195,111 @@ } } + +/* special lang package handling for urpm */ +/* see https://bugs.mageia.org/show_bug.cgi?id=18315 */ + +static int +urpm_reorder_cmp(const void *ap, const void *bp, void *dp) +{ + return ((Id *)bp)[1] - ((Id *)ap)[1]; +} + +static void +urpm_reorder(Solver *solv, Queue *plist) +{ + Pool *pool = solv->pool; + int i, count = plist->count; + /* add locale score to packages */ + queue_insertn(plist, count, count, 0); + for (i = count - 1; i >= 0; i--) + { + Solvable *s = pool->solvables + plist->elements[i]; + int score = 1; + const char *sn = pool_id2str(pool, s->name); + + if (!strncmp(sn, "kernel-", 7)) + { + const char *devel = strstr(sn, "-devel-"); + if (devel && strlen(sn) < 256) + { + char kn[256]; + Id p, pp, knid; + memcpy(kn, sn, devel - sn); + strcpy(kn + (devel - sn), devel + 6); + knid = pool_str2id(pool, kn, 0); + if (knid) + { + FOR_PROVIDES(p, pp, knid) + if (solv->decisionmap[p] > 0 || (pool->installed && pool->solvables[p].repo == pool->installed)) + score = 3; + } + } + } + else if ((sn = strstr(sn, "-kernel-")) != 0) + { + sn += 8; + if (strlen(sn) < 256 - 8 && *sn >= '0' && *sn <= '9' && sn[1] == '.') + { + const char *flavor = strchr(sn, '-'); + if (flavor) + { + const char *release = strchr(flavor + 1, '-'); + if (release) + { + char kn[256]; + Id p, pp, knid; + memcpy(kn, "kernel", 8); + memcpy(kn + 6, flavor, release - flavor + 1); + memcpy(kn + 6 + (release - flavor) + 1, sn, flavor - sn); + strcpy(kn + 6 + (release + 1 - sn), release); + knid = pool_str2id(pool, kn, 0); + if (knid) + { + FOR_PROVIDES(p, pp, knid) + if (solv->decisionmap[p] > 0 || (pool->installed && pool->solvables[p].repo == pool->installed)) + score = 3; + } + } + } + } + } + if (score == 1 && s->requires) + { + Id id, *idp, p, pp; + const char *deps; + for (idp = s->repo->idarraydata + s->requires; (id = *idp) != 0; idp++) + { + while (ISRELDEP(id)) + { + Reldep *rd = GETRELDEP(pool, id); + id = rd->name; + } + deps = strstr(pool_id2str(pool, id), "locales-"); + if (!deps) + continue; + if (!strncmp(deps + 8, "en", 2)) + score = 2; + else + { + score = 0; + FOR_PROVIDES(p, pp, id) + if (solv->decisionmap[p] > 0 || (pool->installed && pool->solvables[p].repo == pool->installed)) + score = 3; + break; + } + } + } + plist->elements[i * 2] = plist->elements[i]; + plist->elements[i * 2 + 1] = score; + } + solv_sort(plist->elements, count, sizeof(Id) * 2, urpm_reorder_cmp, pool); + for (i = 0; i < count; i++) + plist->elements[i] = plist->elements[2 * i]; + queue_truncate(plist, count); +} + + /* * POLICY_MODE_CHOOSE: default, do all pruning steps * POLICY_MODE_RECOMMEND: leave out prune_to_recommended @@ -1121,6 +1309,17 @@ policy_filter_unwanted(Solver *solv, Queue *plist, int mode) { Pool *pool = solv->pool; + if (mode == POLICY_MODE_SUPPLEMENT) + { + /* reorder only */ + dislike_old_versions(pool, plist); + sort_by_common_dep(pool, plist); + if (solv->urpmreorder) + urpm_reorder(solv, plist); + prefer_suggested(solv, plist); + policy_prefer_favored(solv, plist); + return; + } if (plist->count > 1) { if (mode != POLICY_MODE_SUGGEST) @@ -1143,7 +1342,10 @@ #endif dislike_old_versions(pool, plist); sort_by_common_dep(pool, plist); + if (solv->urpmreorder) + urpm_reorder(solv, plist); prefer_suggested(solv, plist); + policy_prefer_favored(solv, plist); } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.20/src/policy.h new/libsolv-0.6.21/src/policy.h --- old/libsolv-0.6.20/src/policy.h 2016-02-11 17:01:33.000000000 +0100 +++ new/libsolv-0.6.21/src/policy.h 2016-05-03 17:42:57.000000000 +0200 @@ -20,6 +20,7 @@ #define POLICY_MODE_RECOMMEND 1 #define POLICY_MODE_SUGGEST 2 #define POLICY_MODE_CHOOSE_NOREORDER 3 /* internal, do not use */ +#define POLICY_MODE_SUPPLEMENT 4 /* internal, do not use */ #define POLICY_ILLEGAL_DOWNGRADE 1 @@ -39,6 +40,7 @@ /* internal, do not use */ extern void prune_to_best_version(Pool *pool, Queue *plist); +extern void policy_prefer_favored(Solver *solv, Queue *plist); #ifdef __cplusplus diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.20/src/poolarch.c new/libsolv-0.6.21/src/poolarch.c --- old/libsolv-0.6.20/src/poolarch.c 2016-02-11 17:01:33.000000000 +0100 +++ new/libsolv-0.6.21/src/poolarch.c 2016-05-06 11:56:00.000000000 +0200 @@ -29,16 +29,10 @@ "i686", "i686:i586:i486:i386", "i586", "i586:i486:i386", "i486", "i486:i386", - "i386", "i386", "s390x", "s390x:s390", - "s390", "s390", - "ppc64le", "ppc64le", "ppc64", "ppc64:ppc", - "ppc", "ppc", "ppc64p7", "ppc64p7:ppc64:ppc", "ia64", "ia64:i686:i586:i486:i386", - "aarch64", "aarch64", - "armv6hl", "armv6hl", "armv7hnl", "armv7hnl:armv7hl:armv6hl", "armv7hl", "armv7hl:armv6hl", "armv7l", "armv7l:armv6l:armv5tejl:armv5tel:armv5l:armv4tl:armv4l:armv3l", @@ -49,21 +43,12 @@ "armv5l", "armv5l:armv4tl:armv4l:armv3l", "armv4tl", "armv4tl:armv4l:armv3l", "armv4l", "armv4l:armv3l", - "armv3l", "armv3l", - "sh3", "sh3", - "sh4", "sh4", "sh4a", "sh4a:sh4", "sparc64v", "sparc64v:sparc64:sparcv9v:sparcv9:sparcv8:sparc", "sparc64", "sparc64:sparcv9:sparcv8:sparc", "sparcv9v", "sparcv9v:sparcv9:sparcv8:sparc", "sparcv9", "sparcv9:sparcv8:sparc", "sparcv8", "sparcv8:sparc", - "sparc", "sparc", - "mips", "mips", - "mipsel", "mipsel", - "mips64", "mips64", - "mips64el", "mips64el", - "m68k", "m68k", #if defined(FEDORA) || defined(MAGEIA) "ia32e", "ia32e:x86_64:athlon:i686:i586:i486:i386", "athlon", "athlon:i686:i586:i486:i386", @@ -81,15 +66,13 @@ if (arch) { int i; - /* convert arch to known policy */ for (i = 0; archpolicies[i]; i += 2) if (!strcmp(archpolicies[i], arch)) - break; - if (archpolicies[i]) - arch = archpolicies[i + 1]; - else - arch = ""; + { + arch = archpolicies[i + 1]; + break; + } } pool_setarchpolicy(pool, arch); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.20/src/selection.c new/libsolv-0.6.21/src/selection.c --- old/libsolv-0.6.20/src/selection.c 2016-04-22 15:56:28.000000000 +0200 +++ new/libsolv-0.6.21/src/selection.c 2016-05-06 12:06:02.000000000 +0200 @@ -923,7 +923,7 @@ int selection_make_matchdeps(Pool *pool, Queue *selection, const char *name, int flags, int keyname, int marker) { - char *rname, *r; + char *rname, *r = 0; int rflags = 0; Id p; Queue q; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.20/src/solver.c new/libsolv-0.6.21/src/solver.c --- old/libsolv-0.6.20/src/solver.c 2016-04-08 14:50:47.000000000 +0200 +++ new/libsolv-0.6.21/src/solver.c 2016-05-17 13:36:02.000000000 +0200 @@ -1432,6 +1432,8 @@ solv->recommends_index = -1; queue_truncate(&solv->decisionq, decisionqcount); } + /* but obey favored maps */ + policy_prefer_favored(solv, dq); } /*------------------------------------------------------------------- @@ -1701,6 +1703,7 @@ queuep_free(&solv->recommendscplxq); queuep_free(&solv->suggestscplxq); queuep_free(&solv->brokenorphanrules); + queuep_free(&solv->favorq); map_free(&solv->recommendsmap); map_free(&solv->suggestsmap); @@ -1716,6 +1719,8 @@ map_free(&solv->droporphanedmap); map_free(&solv->cleandepsmap); map_free(&solv->allowuninstallmap); + map_free(&solv->favormap); + map_free(&solv->isdisfavormap); solv_free(solv->decisionmap); solv_free(solv->rules); @@ -1779,6 +1784,8 @@ return solv->do_yum_obsoletes; case SOLVER_FLAG_NEED_UPDATEPROVIDE: return solv->needupdateprovide; + case SOLVER_FLAG_URPM_REORDER: + return solv->urpmreorder; default: break; } @@ -1857,6 +1864,9 @@ case SOLVER_FLAG_NEED_UPDATEPROVIDE: solv->needupdateprovide = value; break; + case SOLVER_FLAG_URPM_REORDER: + solv->urpmreorder = value; + break; default: break; } @@ -2063,6 +2073,22 @@ #endif +static void +prune_disfavored(Solver *solv, Queue *plist) +{ + int i, j; + if (!solv->isdisfavormap.size) + return; + for (i = j = 0; i < plist->count; i++) + { + Id p = plist->elements[i]; + if (!MAPTST(&solv->isdisfavormap, p)) + plist->elements[j++] = p; + } + if (i != j) + queue_truncate(plist, j); +} + /*------------------------------------------------------------------- * * solver_run_sat @@ -2522,10 +2548,16 @@ continue; if (solv->dupmap_all && solv->installed && s->repo == solv->installed && (solv->droporphanedmap_all || (solv->droporphanedmap.size && MAPTST(&solv->droporphanedmap, i - solv->installed->start)))) continue; + if (solv->isdisfavormap.size && MAPTST(&solv->isdisfavormap, i)) + continue; /* disfavored supplements, do not install */ queue_push(&dqs, i); } } + /* filter out disfavored recommended packages */ + if (dq.count && solv->isdisfavormap.size) + prune_disfavored(solv, &dq); + /* filter out all packages obsoleted by installed packages */ /* this is no longer needed if we have reverse obsoletes */ if ((dqs.count || dq.count) && solv->installed) @@ -2604,6 +2636,26 @@ dqs.count = j; } + /* implicitobsoleteusescolors doesn't mix well with supplements. + * filter supplemented packages where we already decided + * to install a different architecture */ + if (dqs.count && pool->implicitobsoleteusescolors) + { + for (i = j = 0; i < dqs.count; i++) + { + Id p2, pp2; + p = dqs.elements[i]; + s = pool->solvables + p; + FOR_PROVIDES(p2, pp2, s->name) + if (solv->decisionmap[p2] > 0 && pool->solvables[p2].name == s->name && pool->solvables[p2].arch != s->arch) + break; + if (p2) + continue; /* ignore this package */ + dqs.elements[j++] = p; + } + dqs.count = j; + } + /* make dq contain both recommended and supplemented pkgs */ if (dqs.count) { @@ -2636,11 +2688,22 @@ for (i = 0; i < dq.count; i++) MAPSET(&dqmap, dq.elements[i]); - /* install all supplemented packages */ + /* prune dqs so that it only contains the best versions */ + for (i = j = 0; i < dqs.count; i++) + { + p = dqs.elements[i]; + if (MAPTST(&dqmap, p)) + dqs.elements[j++] = p; + } + dqs.count = j; + + /* install all supplemented packages, but order first */ + if (dqs.count > 1) + policy_filter_unwanted(solv, &dqs, POLICY_MODE_SUPPLEMENT); for (i = 0; i < dqs.count; i++) { p = dqs.elements[i]; - if (solv->decisionmap[p] || !MAPTST(&dqmap, p)) + if (solv->decisionmap[p]) continue; POOL_DEBUG(SOLV_DEBUG_POLICY, "installing supplemented %s\n", pool_solvid2str(pool, p)); olevel = level; @@ -3327,6 +3390,42 @@ } #endif +/* sort by package id, last entry wins */ +static int +setup_favormaps_cmp(const void *ap, const void *bp, void *dp) +{ + const Id *a = ap, *b = bp; + if ((*a - *b) != 0) + return *a - *b; + return (b[1] < 0 ? -b[1] : b[1]) - (a[1] < 0 ? -a[1] : a[1]); +} + +static void +setup_favormaps(Solver *solv) +{ + Queue *q = solv->favorq; + Pool *pool = solv->pool; + int i; + Id oldp = 0; + if (q->count > 2) + solv_sort(q->elements, q->count / 2, 2 * sizeof(Id), setup_favormaps_cmp, solv); + map_grow(&solv->favormap, pool->nsolvables); + for (i = 0; i < q->count; i += 2) + { + Id p = q->elements[i]; + if (p == oldp) + continue; + oldp = p; + MAPSET(&solv->favormap, p); + if (q->elements[i + 1] < 0) + { + if (!solv->isdisfavormap.size) + map_grow(&solv->isdisfavormap, pool->nsolvables); + MAPSET(&solv->isdisfavormap, p); + } + } +} + /* * * solve job queue @@ -3400,6 +3499,8 @@ map_zerosize(&solv->allowuninstallmap); map_zerosize(&solv->cleandepsmap); map_zerosize(&solv->weakrulemap); + map_zerosize(&solv->favormap); + map_zerosize(&solv->isdisfavormap); queue_empty(&solv->weakruleq); solv->watches = solv_free(solv->watches); queue_empty(&solv->ruletojob); @@ -3935,6 +4036,21 @@ case SOLVER_ALLOWUNINSTALL: POOL_DEBUG(SOLV_DEBUG_JOB, "job: allowuninstall %s\n", solver_select2str(pool, select, what)); break; + case SOLVER_FAVOR: + case SOLVER_DISFAVOR: + POOL_DEBUG(SOLV_DEBUG_JOB, "job: %s %s\n", (how & SOLVER_JOBMASK) == SOLVER_FAVOR ? "favor" : "disfavor", solver_select2str(pool, select, what)); + FOR_JOB_SELECT(p, pp, select, what) + { + int j; + if (!solv->favorq) + { + solv->favorq = solv_calloc(1, sizeof(Queue)); + queue_init(solv->favorq); + } + j = solv->favorq->count + 1; + queue_push2(solv->favorq, p, (how & SOLVER_JOBMASK) == SOLVER_FAVOR ? j : -j); + } + break; default: POOL_DEBUG(SOLV_DEBUG_JOB, "job: unknown job\n"); break; @@ -3955,6 +4071,10 @@ assert(solv->ruletojob.count == solv->nrules - solv->jobrules); solv->jobrules_end = solv->nrules; + /* transform favorq into two maps */ + if (solv->favorq) + setup_favormaps(solv); + /* now create infarch and dup rules */ if (!solv->noinfarchcheck) { @@ -5157,6 +5277,12 @@ case SOLVER_ALLOWUNINSTALL: strstart = "allow deinstallation of "; break; + case SOLVER_FAVOR: + strstart = "favor "; + break; + case SOLVER_DISFAVOR: + strstart = "disfavor "; + break; default: strstart = "unknown job "; break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.20/src/solver.h new/libsolv-0.6.21/src/solver.h --- old/libsolv-0.6.20/src/solver.h 2016-02-11 17:01:33.000000000 +0100 +++ new/libsolv-0.6.21/src/solver.h 2016-05-13 15:06:01.000000000 +0200 @@ -167,6 +167,7 @@ int noautotarget; /* true: do not assume targeted for up/dup jobs that contain no installed solvable */ int focus_installed; /* true: resolve update rules first */ int do_yum_obsoletes; /* true: add special yumobs rules */ + int urpmreorder; /* true: do special urpm package reordering */ Map dupmap; /* dup these packages*/ int dupmap_all; /* dup all packages */ @@ -199,6 +200,9 @@ Map allowuninstallmap; /* ok to uninstall those */ int allowuninstall_all; + Queue *favorq; + Map favormap; /* favored / disfavored packages */ + Map isdisfavormap; #endif /* LIBSOLV_INTERNAL */ }; @@ -229,6 +233,8 @@ #define SOLVER_DROP_ORPHANED 0x0900 #define SOLVER_USERINSTALLED 0x0a00 #define SOLVER_ALLOWUNINSTALL 0x0b00 +#define SOLVER_FAVOR 0x0c00 +#define SOLVER_DISFAVOR 0x0d00 #define SOLVER_JOBMASK 0xff00 @@ -302,6 +308,7 @@ #define SOLVER_FLAG_FOCUS_INSTALLED 20 #define SOLVER_FLAG_YUM_OBSOLETES 21 #define SOLVER_FLAG_NEED_UPDATEPROVIDE 22 +#define SOLVER_FLAG_URPM_REORDER 23 #define GET_USERINSTALLED_NAMES (1 << 0) /* package names instead of ids */ #define GET_USERINSTALLED_INVERTED (1 << 1) /* autoinstalled */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.20/test/testcases/favor/recommends.t new/libsolv-0.6.21/test/testcases/favor/recommends.t --- old/libsolv-0.6.20/test/testcases/favor/recommends.t 1970-01-01 01:00:00.000000000 +0100 +++ new/libsolv-0.6.21/test/testcases/favor/recommends.t 2016-05-03 16:26:06.000000000 +0200 @@ -0,0 +1,50 @@ +repo system 0 empty +repo test 0 testtags <inline> +#>=Ver: 2.0 +#>=Pkg: A 1 1 noarch +#>=Rec: X +#>=Pkg: B 1 1 noarch +#>=Prv: X +#>=Pkg: C 1 1 noarch +#>=Prv: X +system unset * system + +# first favor B +job install name A +job favor name B +result transaction,problems <inline> +#>install A-1-1.noarch@test +#>install B-1-1.noarch@test + +# then favor C +nextjob +job install name A +job favor name C +result transaction,problems <inline> +#>install A-1-1.noarch@test +#>install C-1-1.noarch@test + +# check disfavor +nextjob +job install name A +job disfavor name B +result transaction,problems <inline> +#>install A-1-1.noarch@test +#>install C-1-1.noarch@test + +nextjob +job install name A +job disfavor name C +result transaction,problems <inline> +#>install A-1-1.noarch@test +#>install B-1-1.noarch@test + +# check disfavor both, this is different from +# the requires case + +nextjob +job install name A +job disfavor name B +job disfavor name C +result transaction,problems <inline> +#>install A-1-1.noarch@test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.20/test/testcases/favor/requires.t new/libsolv-0.6.21/test/testcases/favor/requires.t --- old/libsolv-0.6.20/test/testcases/favor/requires.t 1970-01-01 01:00:00.000000000 +0100 +++ new/libsolv-0.6.21/test/testcases/favor/requires.t 2016-05-03 16:26:06.000000000 +0200 @@ -0,0 +1,112 @@ +repo system 0 empty +repo test 0 testtags <inline> +#>=Ver: 2.0 +#>=Pkg: A 1 1 noarch +#>=Req: X +#>=Pkg: B 1 1 noarch +#>=Prv: X +#>=Pkg: C 1 1 noarch +#>=Prv: X +system unset * system + +# first favor B +job install name A +job favor name B +result transaction,problems <inline> +#>install A-1-1.noarch@test +#>install B-1-1.noarch@test + +# then favor C +nextjob +job install name A +job favor name C +result transaction,problems <inline> +#>install A-1-1.noarch@test +#>install C-1-1.noarch@test + + +# if both are favored, the last one wins +nextjob +job install name A +job favor name C +job favor name B +result transaction,problems <inline> +#>install A-1-1.noarch@test +#>install B-1-1.noarch@test + +nextjob +job install name A +job favor name B +job favor name C +result transaction,problems <inline> +#>install A-1-1.noarch@test +#>install C-1-1.noarch@test + +# now test disfavor + +# first disfavor B +nextjob +job install name A +job disfavor name B +result transaction,problems <inline> +#>install A-1-1.noarch@test +#>install C-1-1.noarch@test + +# then disfavor C +nextjob +job install name A +job disfavor name C +result transaction,problems <inline> +#>install A-1-1.noarch@test +#>install B-1-1.noarch@test + +# then both +nextjob +job install name A +job disfavor name B +job disfavor name C +result transaction,problems <inline> +#>install A-1-1.noarch@test +#>install B-1-1.noarch@test + +nextjob +job install name A +job disfavor name C +job disfavor name B +result transaction,problems <inline> +#>install A-1-1.noarch@test +#>install C-1-1.noarch@test + +# then test combination +nextjob +job install name A +job favor name B +job disfavor name B +result transaction,problems <inline> +#>install A-1-1.noarch@test +#>install C-1-1.noarch@test + +nextjob +job install name A +job disfavor name B +job favor name B +result transaction,problems <inline> +#>install A-1-1.noarch@test +#>install B-1-1.noarch@test + +nextjob +job install name A +job favor name C +job disfavor name C +result transaction,problems <inline> +#>install A-1-1.noarch@test +#>install B-1-1.noarch@test + +nextjob +job install name A +job disfavor name C +job favor name C +result transaction,problems <inline> +#>install A-1-1.noarch@test +#>install C-1-1.noarch@test + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.20/test/testcases/favor/supplements.t new/libsolv-0.6.21/test/testcases/favor/supplements.t --- old/libsolv-0.6.20/test/testcases/favor/supplements.t 1970-01-01 01:00:00.000000000 +0100 +++ new/libsolv-0.6.21/test/testcases/favor/supplements.t 2016-05-03 16:26:06.000000000 +0200 @@ -0,0 +1,71 @@ +repo system 0 empty +repo test 0 testtags <inline> +#>=Ver: 2.0 +#>=Pkg: A 1 1 noarch +#>=Pkg: B 1 1 noarch +#>=Sup: A +#>=Pkg: C 1 1 noarch +#>=Sup: A +#>=Pkg: A2 1 1 noarch +#>=Pkg: B2 1 1 noarch +#>=Sup: A2 +#>=Pkg: C2 1 1 noarch +#>=Sup: A2 +#>=Con: B2 +system unset * system + +# first favor B +job install name A +job favor name B +result transaction,problems <inline> +#>install A-1-1.noarch@test +#>install B-1-1.noarch@test +#>install C-1-1.noarch@test + +# then favor C +nextjob +job install name A +job favor name C +result transaction,problems <inline> +#>install A-1-1.noarch@test +#>install B-1-1.noarch@test +#>install C-1-1.noarch@test + +# same with A2 where B2 and C2 conflict + +nextjob +job install name A2 +job favor name B2 +result transaction,problems <inline> +#>install A2-1-1.noarch@test +#>install B2-1-1.noarch@test + +nextjob +job install name A2 +job favor name C2 +result transaction,problems <inline> +#>install A2-1-1.noarch@test +#>install C2-1-1.noarch@test + + +# check disfavor +nextjob +job install name A +job disfavor name B +result transaction,problems <inline> +#>install A-1-1.noarch@test +#>install C-1-1.noarch@test + +nextjob +job install name A +job disfavor name C +result transaction,problems <inline> +#>install A-1-1.noarch@test +#>install B-1-1.noarch@test + +nextjob +job install name A +job disfavor name B +job disfavor name C +result transaction,problems <inline> +#>install A-1-1.noarch@test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.20/test/testcases/weakdeps/supplements_implicitobsoleteusescolors.t new/libsolv-0.6.21/test/testcases/weakdeps/supplements_implicitobsoleteusescolors.t --- old/libsolv-0.6.20/test/testcases/weakdeps/supplements_implicitobsoleteusescolors.t 1970-01-01 01:00:00.000000000 +0100 +++ new/libsolv-0.6.21/test/testcases/weakdeps/supplements_implicitobsoleteusescolors.t 2016-05-17 13:36:02.000000000 +0200 @@ -0,0 +1,20 @@ +repo system 0 empty +repo test 0 testtags <inline> +#>=Ver: 2.0 +#>=Pkg: A 1 1 noarch +#>=Pkg: B 1 1 x86_64 +#>=Sup: A +#>=Pkg: B 1 1 i686 +#>=Sup: A +#>=Pkg: A2 1 1 noarch +#>=Pkg: B2 1 1 x86_64 +#>=Sup: A2 +#>=Req: XX +#>=Pkg: B2 1 1 i686 +#>=Sup: A2 +system x86_64 * system +poolflags implicitobsoleteusescolors +job install name A + +nextjob +job install name A2