Hello community, here is the log from the commit of package libsolv for openSUSE:Factory checked in at 2012-12-07 14:41:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libsolv (Old) and /work/SRC/openSUSE:Factory/.libsolv.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "libsolv", Maintainer is "" Changes: -------- --- /work/SRC/openSUSE:Factory/libsolv/libsolv.changes 2012-12-05 13:57:34.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.libsolv.new/libsolv.changes 2012-12-07 14:42:06.000000000 +0100 @@ -1,0 +2,9 @@ +Wed Dec 5 14:37:39 CET 2012 - mls@suse.de + +- many Selection improvements +- fix perl binding memory issue +- improve file list matching +- support targeted up/dup with cleandeps +- bump version to 0.2.2 + +------------------------------------------------------------------- Old: ---- libsolv-0.2.1.tar.bz2 New: ---- libsolv-0.2.2.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libsolv.spec ++++++ --- /var/tmp/diff_new_pack.tJwpCE/_old 2012-12-07 14:42:07.000000000 +0100 +++ /var/tmp/diff_new_pack.tJwpCE/_new 2012-12-07 14:42:07.000000000 +0100 @@ -16,7 +16,7 @@ # Name: libsolv -Version: 0.2.1 +Version: 0.2.2 Release: 0 Url: git://gitorious.org/opensuse/libsolv.git Source: libsolv-%{version}.tar.bz2 ++++++ libsolv-0.2.1.tar.bz2 -> libsolv-0.2.2.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.2.1/VERSION.cmake new/libsolv-0.2.2/VERSION.cmake --- old/libsolv-0.2.1/VERSION.cmake 2012-11-30 16:53:53.000000000 +0100 +++ new/libsolv-0.2.2/VERSION.cmake 2012-12-05 14:38:04.000000000 +0100 @@ -49,5 +49,5 @@ SET(LIBSOLV_MAJOR "0") SET(LIBSOLV_MINOR "2") -SET(LIBSOLV_PATCH "1") +SET(LIBSOLV_PATCH "2") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.2.1/bindings/solv.i new/libsolv-0.2.2/bindings/solv.i --- old/libsolv-0.2.1/bindings/solv.i 2012-11-30 16:53:53.000000000 +0100 +++ new/libsolv-0.2.2/bindings/solv.i 2012-12-05 14:38:04.000000000 +0100 @@ -777,11 +777,14 @@ static const Id SOLVER_WEAK = SOLVER_WEAK; static const Id SOLVER_ESSENTIAL = SOLVER_ESSENTIAL; static const Id SOLVER_CLEANDEPS = SOLVER_CLEANDEPS; + static const Id SOLVER_FORCEBEST = SOLVER_FORCEBEST; + static const Id SOLVER_TARGETED = SOLVER_TARGETED; static const Id SOLVER_SETEV = SOLVER_SETEV; static const Id SOLVER_SETEVR = SOLVER_SETEVR; static const Id SOLVER_SETARCH = SOLVER_SETARCH; static const Id SOLVER_SETVENDOR = SOLVER_SETVENDOR; static const Id SOLVER_SETREPO = SOLVER_SETREPO; + static const Id SOLVER_SETNAME = SOLVER_SETNAME; static const Id SOLVER_NOAUTOSET = SOLVER_NOAUTOSET; static const Id SOLVER_SETMASK = SOLVER_SETMASK; @@ -830,10 +833,13 @@ static const Id SELECTION_NAME = SELECTION_NAME; static const Id SELECTION_PROVIDES = SELECTION_PROVIDES; static const Id SELECTION_FILELIST = SELECTION_FILELIST; - static const Id SELECTION_GLOB = SELECTION_GLOB; - static const Id SELECTION_NOCASE = SELECTION_NOCASE; + static const Id SELECTION_CANON = SELECTION_CANON; + static const Id SELECTION_DOTARCH = SELECTION_DOTARCH; + static const Id SELECTION_REL = SELECTION_REL; static const Id SELECTION_INSTALLED_ONLY = SELECTION_INSTALLED_ONLY; + static const Id SELECTION_GLOB = SELECTION_GLOB; static const Id SELECTION_FLAT = SELECTION_FLAT; + static const Id SELECTION_NOCASE = SELECTION_NOCASE; static const Id SELECTION_SOURCE_ONLY = SELECTION_SOURCE_ONLY; static const Id SELECTION_WITH_SOURCE = SELECTION_WITH_SOURCE; @@ -860,11 +866,11 @@ bool isempty() { return $self->q.count == 0; } - void limit(Selection *lsel) { + void filter(Selection *lsel) { if ($self->pool != lsel->pool) queue_empty(&$self->q); else - selection_limit($self->pool, &$self->q, &lsel->q); + selection_filter($self->pool, &$self->q, &lsel->q); } void add(Selection *lsel) { if ($self->pool == lsel->pool) @@ -1311,6 +1317,12 @@ Selection *Selection() { return new_Selection($self); } + %newobject Selection_all; + Selection *Selection_all(int setflags=0) { + Selection *sel = new_Selection($self); + queue_push2(&sel->q, SOLVER_SOLVABLE_ALL | setflags, 0); + return sel; + } %newobject select; Selection *select(const char *name, int flags) { Selection *sel = new_Selection($self); @@ -1506,6 +1518,14 @@ return new_XRepodata($self, 1); } + %newobject Selection; + Selection *Selection(int setflags=0) { + Selection *sel = new_Selection($self->pool); + setflags |= SOLVER_SETREPO; + queue_push2(&sel->q, SOLVER_SOLVABLE_REPO | setflags, $self->repoid); + return sel; + } + bool __eq__(Repo *repo) { return $self == repo; } @@ -1914,6 +1934,40 @@ s->id = id; return s; } + %newobject Rel; + Dep *Rel(int flags, DepId evrid, bool create=1) { + Id id = pool_rel2id($self->pool, $self->id, evrid, flags, create); + if (!id) + return 0; + return new_Dep($self->pool, id); + } + %newobject Selection_name; + Selection *Selection_name(int setflags=0) { + Selection *sel = new_Selection($self->pool); + if (ISRELDEP($self->id)) { + Reldep *rd = GETRELDEP($self->pool, $self->id); + if (rd->flags == REL_EQ) { + setflags |= $self->pool->disttype == DISTTYPE_DEB || strchr(pool_id2str($self->pool, rd->evr), '-') != 0 ? SOLVER_SETEVR : SOLVER_SETEV; + if (ISRELDEP(rd->name)) + rd = GETRELDEP($self->pool, rd->name); + } + if (rd->flags == REL_ARCH) + setflags |= SOLVER_SETARCH; + } + queue_push2(&sel->q, SOLVER_SOLVABLE_NAME | setflags, $self->id); + return sel; + } + %newobject Selection_provides; + Selection *Selection_provides(int setflags=0) { + Selection *sel = new_Selection($self->pool); + if (ISRELDEP($self->id)) { + Reldep *rd = GETRELDEP($self->pool, $self->id); + if (rd->flags == REL_ARCH) + setflags |= SOLVER_SETARCH; + } + queue_push2(&sel->q, SOLVER_SOLVABLE_PROVIDES | setflags, $self->id); + return sel; + } const char *str() { return pool_dep2str($self->pool, $self->id); } @@ -2159,6 +2213,13 @@ solvable_add_deparray(s, keyname, id, marker); } + %newobject Selection; + Selection *Selection(int setflags=0) { + Selection *sel = new_Selection($self->pool); + queue_push2(&sel->q, SOLVER_SOLVABLE | setflags, $self->id); + return sel; + } + bool __eq__(XSolvable *s) { return $self->pool == s->pool && $self->id == s->id; } @@ -2372,7 +2433,7 @@ Id extraflags = solver_solutionelement_extrajobflags($self->solv, $self->problemid, $self->solutionid); if ($self->type == SOLVER_SOLUTION_JOB) return new_Job($self->solv->pool, SOLVER_NOOP, 0); - if ($self->type == SOLVER_SOLUTION_INFARCH || $self->type == SOLVER_SOLUTION_DISTUPGRADE) + if ($self->type == SOLVER_SOLUTION_INFARCH || $self->type == SOLVER_SOLUTION_DISTUPGRADE || $self->type == SOLVER_SOLUTION_BEST) return new_Job($self->solv->pool, SOLVER_INSTALL|SOLVER_SOLVABLE|extraflags, $self->p); if ($self->type == SOLVER_SOLUTION_REPLACE || $self->type == SOLVER_SOLUTION_REPLACE_DOWNGRADE || $self->type == SOLVER_SOLUTION_REPLACE_ARCHCHANGE || $self->type == SOLVER_SOLUTION_REPLACE_VENDORCHANGE) return new_Job($self->solv->pool, SOLVER_INSTALL|SOLVER_SOLVABLE|extraflags, $self->rp); @@ -2406,6 +2467,7 @@ static const int SOLVER_SOLUTION_JOB = SOLVER_SOLUTION_JOB; static const int SOLVER_SOLUTION_INFARCH = SOLVER_SOLUTION_INFARCH; static const int SOLVER_SOLUTION_DISTUPGRADE = SOLVER_SOLUTION_DISTUPGRADE; + static const int SOLVER_SOLUTION_BEST = SOLVER_SOLUTION_BEST; static const int SOLVER_SOLUTION_ERASE = SOLVER_SOLUTION_ERASE; static const int SOLVER_SOLUTION_REPLACE = SOLVER_SOLUTION_REPLACE; static const int SOLVER_SOLUTION_REPLACE_DOWNGRADE = SOLVER_SOLUTION_REPLACE_DOWNGRADE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.2.1/examples/p5solv new/libsolv-0.2.2/examples/p5solv --- old/libsolv-0.2.1/examples/p5solv 2012-11-30 16:53:53.000000000 +0100 +++ new/libsolv-0.2.2/examples/p5solv 2012-12-05 14:38:04.000000000 +0100 @@ -568,6 +568,7 @@ my @jobs; for my $arg (@ARGV) { my $flags = $solv::Selection::SELECTION_NAME | $solv::Selection::SELECTION_PROVIDES | $solv::Selection::SELECTION_GLOB; + $flags |= $solv::Selection::SELECTION_CANON | $solv::Selection::SELECTION_DOTARCH | $solv::Selection::SELECTION_REL; if ($arg =~ /^\//) { $flags |= $solv::Selection::SELECTION_FILELIST; $flags |= $solv::Selection::SELECTION_INSTALLED_ONLY if $cmd eq 'erase'; @@ -584,8 +585,7 @@ } if (!@jobs && ($cmd eq 'up' || $cmd eq 'dup' || $cmd eq 'verify')) { - my $sel = $pool->Selection(); - $sel->add_raw($solv::Job::SOLVER_SOLVABLE_ALL, 0); + my $sel = $pool->Selection_all(); push @jobs, $sel->jobs($cmdactionmap{$cmd}); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.2.1/examples/pysolv new/libsolv-0.2.2/examples/pysolv --- old/libsolv-0.2.1/examples/pysolv 2012-11-30 16:53:53.000000000 +0100 +++ new/libsolv-0.2.2/examples/pysolv 2012-12-05 14:38:04.000000000 +0100 @@ -568,7 +568,9 @@ parser = OptionParser(usage="usage: solv.py [options] COMMAND") -parser.add_option('-r', '--repo', action="append", type="string", dest="repos") +parser.add_option('-r', '--repo', action="append", type="string", dest="repos", help="limit to specified repositories") +parser.add_option('--best', action="store_true", dest="best", help="force installation/update to best packages") +parser.add_option('--clean', action="store_true", dest="clean", help="delete no longer needed packages") (options, args) = parser.parse_args() if not args: parser.print_help(sys.stderr) @@ -631,7 +633,7 @@ if int(repo['enabled']): repo.load(pool) -repolimiter = None +repofilter = None if options.repos: for reponame in options.repos: mrepos = [ repo for repo in repos if repo.name == reponame ] @@ -640,9 +642,9 @@ sys.exit(1) repo = mrepos[0] if hasattr(repo, 'handle'): - if not repolimiter: - repolimiter = pool.Selection() - repolimiter.add_raw(Job.SOLVER_SOLVABLE_REPO|Job.SOLVER_SETREPO|Job.SOLVER_SETVENDOR, repo.handle.id) + if not repofilter: + repofilter = pool.Selection() + repofilter.add(repo.handle.Selection(Job.SOLVER_SETVENDOR)) if cmd == 'search': pool.createwhatprovides() @@ -650,8 +652,8 @@ di = pool.Dataiterator(0, solv.SOLVABLE_NAME, args[0], Dataiterator.SEARCH_SUBSTRING|Dataiterator.SEARCH_NOCASE) for d in di: sel.add_raw(Job.SOLVER_SOLVABLE, d.solvid) - if repolimiter: - sel.limit(repolimiter) + if repofilter: + sel.filter(repofilter) for s in sel.solvables(): print " - %s [%s]: %s" % (s, s.repo.name, s.lookup_str(solv.SOLVABLE_SUMMARY)) sys.exit(0) @@ -687,17 +689,18 @@ jobs.append(pool.Job(Job.SOLVER_SOLVABLE, cmdlinerepo['packages'][arg])) else: flags = Selection.SELECTION_NAME|Selection.SELECTION_PROVIDES|Selection.SELECTION_GLOB + flags |= Selection.SELECTION_CANON|Selection.SELECTION_DOTARCH|Selection.SELECTION_REL if len(arg) and arg[0] == '/': flags |= Selection.SELECTION_FILELIST if cmd == 'erase': flags |= Selection.SELECTION_INSTALLED_ONLY sel = pool.select(arg, flags) - if repolimiter: - sel.limit(repolimiter) + if repofilter: + sel.filter(repofilter) if sel.isempty(): sel = pool.select(arg, flags | Selection.SELECTION_NOCASE) - if repolimiter: - sel.limit(repolimiter) + if repofilter: + sel.filter(repofilter) if not sel.isempty(): print "[ignoring case for '%s']" % arg if sel.isempty(): @@ -709,11 +712,10 @@ print "[using capability match for '%s']" % arg jobs += sel.jobs(cmdactionmap[cmd]) -if not jobs and (cmd == 'up' or cmd == 'dup' or cmd == 'verify' or repolimiter): - sel = pool.Selection() - sel.add_raw(Job.SOLVER_SOLVABLE_ALL, 0) - if repolimiter: - sel.limit(repolimiter) +if not jobs and (cmd == 'up' or cmd == 'dup' or cmd == 'verify' or repofilter): + sel = pool.Selection_all() + if repofilter: + sel.filter(repofilter) jobs += sel.jobs(cmdactionmap[cmd]) if not jobs: @@ -744,6 +746,10 @@ for job in jobs: if cmd == 'up' and job.isemptyupdate(): job.how ^= Job.SOLVER_UPDATE ^ Job.SOLVER_INSTALL + if options.best: + job.how |= Job.SOLVER_FORCEBEST + if options.clean: + job.how |= Job.SOLVER_CLEANDEPS #pool.set_debuglevel(2) solver = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.2.1/examples/rbsolv new/libsolv-0.2.2/examples/rbsolv --- old/libsolv-0.2.1/examples/rbsolv 2012-11-30 16:53:53.000000000 +0100 +++ new/libsolv-0.2.2/examples/rbsolv 2012-12-05 14:38:04.000000000 +0100 @@ -580,7 +580,8 @@ jobs = [] for arg in args - flags = Solv::Selection::SELECTION_NAME | Solv::Selection::SELECTION_PROVIDES|Solv::Selection::SELECTION_GLOB + flags = Solv::Selection::SELECTION_NAME | Solv::Selection::SELECTION_PROVIDES | Solv::Selection::SELECTION_GLOB + flags |= Solv::Selection::SELECTION_CANON | Solv::Selection::SELECTION_DOTARCH | Solv::Selection::SELECTION_REL if arg =~ /^\// flags |= Solv::Selection::SELECTION_FILELIST flags |= Solv::Selection::SELECTION_INSTALLED_ONLY if cmd == 'erase' @@ -596,8 +597,7 @@ end if jobs.empty? && (cmd == 'up' || cmd == 'dup' || cmd == 'verify') - sel = pool.Selection() - sel.add_raw(Solv::Job::SOLVER_SOLVABLE_ALL, 0) + sel = pool.Selection_all() jobs += sel.jobs(cmdactionmap[cmd]) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.2.1/examples/solv.c new/libsolv-0.2.2/examples/solv.c --- old/libsolv-0.2.1/examples/solv.c 2012-11-30 16:53:53.000000000 +0100 +++ new/libsolv-0.2.2/examples/solv.c 2012-12-05 14:38:04.000000000 +0100 @@ -2612,7 +2612,7 @@ queue_push2(&sel, SOLVER_SOLVABLE, di.solvid); dataiterator_free(&di); if (repofilter.count) - selection_limit(pool, &sel, &repofilter); + selection_filter(pool, &sel, &repofilter); queue_init(&q); selection_solvables(pool, &sel, &q); @@ -2692,19 +2692,20 @@ } queue_init(&job2); flags = SELECTION_NAME|SELECTION_PROVIDES|SELECTION_GLOB; + flags |= SELECTION_CANON|SELECTION_DOTARCH|SELECTION_REL; if (mode == MODE_LIST) flags |= SELECTION_WITH_SOURCE; if (argv[i][0] == '/') flags |= SELECTION_FILELIST | (mode == MODE_ERASE ? SELECTION_INSTALLED_ONLY : 0); rflags = selection_make(pool, &job2, argv[i], flags); if (repofilter.count) - selection_limit(pool, &job2, &repofilter); + selection_filter(pool, &job2, &repofilter); if (!job2.count) { flags |= SELECTION_NOCASE; rflags = selection_make(pool, &job2, argv[i], flags); if (repofilter.count) - selection_limit(pool, &job2, &repofilter); + selection_filter(pool, &job2, &repofilter); if (job2.count) printf("[ignoring case for '%s']\n", argv[i]); } @@ -2726,7 +2727,7 @@ { queue_push2(&job, SOLVER_SOLVABLE_ALL, 0); if (repofilter.count) - selection_limit(pool, &job, &repofilter); + selection_filter(pool, &job, &repofilter); } queue_free(&repofilter); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.2.1/package/libsolv.changes new/libsolv-0.2.2/package/libsolv.changes --- old/libsolv-0.2.1/package/libsolv.changes 2012-11-30 16:53:53.000000000 +0100 +++ new/libsolv-0.2.2/package/libsolv.changes 2012-12-05 14:38:04.000000000 +0100 @@ -1,4 +1,13 @@ ------------------------------------------------------------------- +Wed Dec 5 14:37:39 CET 2012 - mls@suse.de + +- many Selection improvements +- fix perl binding memory issue +- improve file list matching +- support targeted up/dup with cleandeps +- bump version to 0.2.2 + +------------------------------------------------------------------- Fri Nov 23 13:57:19 CET 2012 - mls@suse.de - support targeted up/dup diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.2.1/src/libsolv.ver new/libsolv-0.2.2/src/libsolv.ver --- old/libsolv-0.2.1/src/libsolv.ver 2012-11-30 16:53:53.000000000 +0100 +++ new/libsolv-0.2.2/src/libsolv.ver 2012-12-05 14:38:04.000000000 +0100 @@ -228,7 +228,7 @@ repodata_write_filtered; repopagestore_compress_page; selection_add; - selection_limit; + selection_filter; selection_make; selection_solvables; solv_bin2hex; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.2.1/src/rules.c new/libsolv-0.2.2/src/rules.c --- old/libsolv-0.2.1/src/rules.c 2012-11-30 16:53:53.000000000 +0100 +++ new/libsolv-0.2.2/src/rules.c 2012-12-05 14:38:04.000000000 +0100 @@ -1181,6 +1181,17 @@ *** ***/ +static inline void +add_cleandeps_package(Solver *solv, Id p) +{ + if (!solv->cleandeps_updatepkgs) + { + solv->cleandeps_updatepkgs = solv_calloc(1, sizeof(Queue)); + queue_init(solv->cleandeps_updatepkgs); + } + queue_pushunique(solv->cleandeps_updatepkgs, p); +} + static inline void solver_addtodupmaps(Solver *solv, Id p, Id how, int targeted) { @@ -1211,6 +1222,8 @@ map_grow(&solv->bestupdatemap, installed->end - installed->start); MAPSET(&solv->bestupdatemap, pi - installed->start); } + if (ps->repo == installed && (how & SOLVER_CLEANDEPS) != 0) + add_cleandeps_package(solv, pi); if (!targeted && ps->repo != installed) MAPSET(&solv->dupmap, pi); } @@ -1254,6 +1267,8 @@ map_grow(&solv->bestupdatemap, installed->end - installed->start); MAPSET(&solv->bestupdatemap, pi - installed->start); } + if (ps->repo == installed && (how & SOLVER_CLEANDEPS) != 0) + add_cleandeps_package(solv, pi); } } } @@ -2692,7 +2707,7 @@ Id p, pp, ip, jp; Id req, *reqp, sup, *supp; Solvable *s; - Queue iq; + Queue iq, iqcopy; int i; map_empty(cleandepsmap); @@ -2787,9 +2802,9 @@ for (rid = solv->jobrules; rid < solv->jobrules_end; rid++) { r = solv->rules + rid; - if (r->d < 0) + if (r->d < 0) /* disabled? */ continue; - if (r->d == 0 && r->p < 0 && r->w2 == 0) + if (r->d == 0 && r->p < 0 && r->w2 == 0) /* negative assertion (erase job)? */ { p = -r->p; if (pool->solvables[p].repo != installed) @@ -2802,7 +2817,7 @@ if ((how & (SOLVER_JOBMASK|SOLVER_CLEANDEPS)) == (SOLVER_ERASE|SOLVER_CLEANDEPS)) queue_push(&iq, p); } - else if (r->p > 0) + else if (r->p > 0) /* install job */ { if (unneeded) continue; @@ -2859,6 +2874,7 @@ } } } + queue_init_clone(&iqcopy, &iq); if (!unneeded) { @@ -3134,12 +3150,17 @@ } queue_free(&iq); + /* make sure the updatepkgs and mistakes are not in the cleandeps map */ if (solv->cleandeps_updatepkgs) for (i = 0; i < solv->cleandeps_updatepkgs->count; i++) MAPSET(&im, solv->cleandeps_updatepkgs->elements[i]); if (solv->cleandeps_mistakes) for (i = 0; i < solv->cleandeps_mistakes->count; i++) MAPSET(&im, solv->cleandeps_mistakes->elements[i]); + /* also remove original iq packages */ + for (i = 0; i < iqcopy.count; i++) + MAPSET(&im, iqcopy.elements[i]); + queue_free(&iqcopy); for (p = installed->start; p < installed->end; p++) { if (pool->solvables[p].repo != installed) @@ -3150,6 +3171,12 @@ map_free(&im); map_free(&installedm); map_free(&userinstalled); +#ifdef CLEANDEPSDEBUG + printf("=== final cleandeps map:\n"); + for (p = installed->start; p < installed->end; p++) + if (MAPTST(cleandepsmap, p - installed->start)) + printf(" - %s\n", pool_solvid2str(pool, p)); +#endif } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.2.1/src/selection.c new/libsolv-0.2.2/src/selection.c --- old/libsolv-0.2.1/src/selection.c 2012-11-30 16:53:53.000000000 +0100 +++ new/libsolv-0.2.2/src/selection.c 2012-12-05 14:38:04.000000000 +0100 @@ -152,7 +152,7 @@ } static void -selection_limit_rel(Pool *pool, Queue *selection, Id relflags, Id relevr) +selection_filter_rel(Pool *pool, Queue *selection, Id relflags, Id relevr) { int i; for (i = 0; i < selection->count; i += 2) @@ -358,7 +358,7 @@ if (doglob && (flags & SELECTION_NOCASE) != 0) globflags = FNM_CASEFOLD; -#if 0 /* doesn't work with selection_limit_rel yet */ +#if 0 /* doesn't work with selection_filter_rel yet */ if (doglob && !strcmp(name, "*") && (flags & SELECTION_FLAT) != 0) { /* can't do this for SELECTION_PROVIDES, as src rpms don't provide anything */ @@ -438,6 +438,8 @@ if ((ret = selection_depglob(pool, selection, name, flags)) != 0) return ret; + if (!(flags & SELECTION_DOTARCH)) + return 0; /* check if there is an .arch suffix */ if ((r = strrchr(name, '.')) != 0 && r[1] && (archid = str2archid(pool, r + 1)) != 0) { @@ -447,9 +449,9 @@ flags |= SELECTION_SOURCE_ONLY; if ((ret = selection_depglob(pool, selection, rname, flags)) != 0) { - selection_limit_rel(pool, selection, REL_ARCH, archid); + selection_filter_rel(pool, selection, REL_ARCH, archid); solv_free(rname); - return ret; + return ret | SELECTION_DOTARCH; } solv_free(rname); } @@ -531,9 +533,9 @@ if ((ret = selection_depglob_arch(pool, selection, rname, flags)) != 0) { if (rflags) - selection_limit_rel(pool, selection, rflags, pool_str2id(pool, r, 1)); + selection_filter_rel(pool, selection, rflags, pool_str2id(pool, r, 1)); solv_free(rname); - return ret; + return ret | SELECTION_REL; } solv_free(rname); return 0; @@ -549,7 +551,7 @@ /* magic epoch promotion code, works only for SELECTION_NAME selections */ static void -selection_limit_evr(Pool *pool, Queue *selection, char *evr) +selection_filter_evr(Pool *pool, Queue *selection, char *evr) { int i, j; Queue q; @@ -585,7 +587,7 @@ queue_push(&q, p); if (sp > sevr) { - while (sevr < sp && *sevr == '0') /* normalize */ + while (sevr < sp && *sevr == '0') /* normalize epoch */ sevr++; } if (!lastepoch) @@ -600,7 +602,7 @@ id = pool_str2id(pool, evr, 1); /* no match at all or zero epoch */ else if (lastepochlen >= 0) { - /* found exactly one epoch, simlpy prepend */ + /* found exactly one epoch, simply prepend */ char *evrx = solv_malloc(strlen(evr) + lastepochlen + 2); strncpy(evrx, lastepoch, lastepochlen + 1); strcpy(evrx + lastepochlen + 1, evr); @@ -609,7 +611,7 @@ } else { - /* multiple epochs in multiple solvables, convert to listy of solvables */ + /* multiple epochs in multiple solvables, convert to list of solvables */ selection->elements[j] = (selection->elements[i] & ~SOLVER_SELECTMASK) | SOLVER_SOLVABLE_ONE_OF; selection->elements[j + 1] = pool_queuetowhatprovides(pool, &q); j += 2; @@ -617,12 +619,9 @@ } queue_empty(&q); queue_push2(&q, selection->elements[i], selection->elements[i + 1]); - selection_limit_rel(pool, &q, REL_EQ, id); + selection_filter_rel(pool, &q, REL_EQ, id); if (!q.count) - { - queue_free(&q); - continue; /* oops, no match */ - } + continue; /* oops, no match */ selection->elements[j] = q.elements[0]; selection->elements[j + 1] = q.elements[1]; j += 2; @@ -631,8 +630,9 @@ queue_free(&q); } +/* match the "canonical" name of the package */ static int -selection_nevra(Pool *pool, Queue *selection, const char *name, int flags) +selection_canon(Pool *pool, Queue *selection, const char *name, int flags) { char *rname, *r, *r2; Id archid = 0; @@ -663,11 +663,11 @@ if ((r2 = strchr(r, '_')) != 0 && r[1] && (archid = str2archid(pool, r + 1)) != 0) { *r2 = 0; /* split off */ - selection_limit_rel(pool, selection, REL_ARCH, archid); + selection_filter_rel(pool, selection, REL_ARCH, archid); } - selection_limit_rel(pool, selection, REL_EQ, pool_str2id(pool, r, 1)); + selection_filter_rel(pool, selection, REL_EQ, pool_str2id(pool, r, 1)); solv_free(rname); - return ret; + return ret | SELECTION_CANON; } if ((r = strrchr(name, '-')) == 0) @@ -701,10 +701,10 @@ } } if (archid) - selection_limit_rel(pool, selection, REL_ARCH, archid); - selection_limit_evr(pool, selection, r + 1); /* magic epoch promotion */ + selection_filter_rel(pool, selection, REL_ARCH, archid); + selection_filter_evr(pool, selection, r + 1); /* magic epoch promotion */ solv_free(rname); - return ret; + return ret | SELECTION_CANON; } int @@ -716,19 +716,20 @@ queue_empty(selection); if (*name == '/' && (flags & SELECTION_FILELIST)) ret = selection_filelist(pool, selection, name, flags); - if (!ret && (r = strpbrk(name, "<=>")) != 0) + if (!ret && (flags & SELECTION_REL) != 0 && (r = strpbrk(name, "<=>")) != 0) ret = selection_rel(pool, selection, name, flags); if (!ret) ret = selection_depglob_arch(pool, selection, name, flags); - if (!ret && (flags & SELECTION_NAME) != 0) - ret = selection_nevra(pool, selection, name, flags); + if (!ret && (flags & SELECTION_CANON) != 0) + ret = selection_canon(pool, selection, name, flags); + if (ret && (flags & SELECTION_FLAT) != 0) selection_flatten(pool, selection); return ret; } void -selection_limit(Pool *pool, Queue *sel1, Queue *sel2) +selection_filter(Pool *pool, Queue *sel1, Queue *sel2) { int i, j, miss; Id p, pp; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.2.1/src/selection.h new/libsolv-0.2.2/src/selection.h --- old/libsolv-0.2.1/src/selection.h 2012-11-30 16:53:53.000000000 +0100 +++ new/libsolv-0.2.2/src/selection.h 2012-12-05 14:38:04.000000000 +0100 @@ -18,6 +18,9 @@ #define SELECTION_NAME (1 << 0) #define SELECTION_PROVIDES (1 << 1) #define SELECTION_FILELIST (1 << 2) +#define SELECTION_CANON (1 << 3) +#define SELECTION_DOTARCH (1 << 4) +#define SELECTION_REL (1 << 5) #define SELECTION_INSTALLED_ONLY (1 << 8) #define SELECTION_GLOB (1 << 9) @@ -27,7 +30,7 @@ #define SELECTION_WITH_SOURCE (1 << 13) extern int selection_make(Pool *pool, Queue *selection, const char *name, int flags); -extern void selection_limit(Pool *pool, Queue *sel1, Queue *sel2); +extern void selection_filter(Pool *pool, Queue *sel1, Queue *sel2); extern void selection_add(Pool *pool, Queue *sel1, Queue *sel2); extern void selection_solvables(Pool *pool, Queue *selection, Queue *pkgs); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.2.1/src/solver.c new/libsolv-0.2.2/src/solver.c --- old/libsolv-0.2.1/src/solver.c 2012-11-30 16:53:53.000000000 +0100 +++ new/libsolv-0.2.2/src/solver.c 2012-12-05 14:38:04.000000000 +0100 @@ -1868,8 +1868,12 @@ olevel = level; if (solv->cleandepsmap.size && MAPTST(&solv->cleandepsmap, i - installed->start)) { +#if 0 POOL_DEBUG(SOLV_DEBUG_POLICY, "cleandeps erasing %s\n", pool_solvid2str(pool, i)); level = setpropagatelearn(solv, level, -i, disablerules, 0); +#else + continue; +#endif } else { @@ -1979,6 +1983,20 @@ * the rule is unit */ assert(dq.count > 1); + /* prune to cleandeps packages */ + if (solv->cleandepsmap.size && solv->installed) + { + Repo *installed = solv->installed; + for (j = 0; j < dq.count; j++) + if (pool->solvables[dq.elements[j]].repo == installed && MAPTST(&solv->cleandepsmap, dq.elements[j] - installed->start)) + break; + if (j < dq.count) + { + dq.elements[0] = dq.elements[j]; + queue_truncate(&dq, 1); + } + } + olevel = level; level = selectandinstall(solv, level, &dq, disablerules, r - solv->rules); if (level == 0) @@ -1998,6 +2016,27 @@ /* at this point we have a consistent system. now do the extras... */ + /* first decide leftover cleandeps packages */ + if (solv->cleandepsmap.size && solv->installed) + { + for (p = solv->installed->start; p < solv->installed->end; p++) + { + s = pool->solvables + p; + if (s->repo != solv->installed) + continue; + if (solv->decisionmap[p] == 0 && MAPTST(&solv->cleandepsmap, p - solv->installed->start)) + { + POOL_DEBUG(SOLV_DEBUG_POLICY, "cleandeps erasing %s\n", pool_solvid2str(pool, p)); + olevel = level; + level = setpropagatelearn(solv, level, -p, 0, 0); + if (level < olevel) + break; + } + } + if (p < solv->installed->end) + continue; + } + solv->decisioncnt_weak = solv->decisionq.count; if (doweak) { @@ -2310,6 +2349,7 @@ if (cleandeps_check_mistakes(solv, level)) { level = 1; /* restart from scratch */ + systemlevel = level + 1; continue; } } @@ -2599,6 +2639,17 @@ queue_push(&solv->weakruleq, solv->nrules - 1); } +static inline void +add_cleandeps_package(Solver *solv, Id p) +{ + if (!solv->cleandeps_updatepkgs) + { + solv->cleandeps_updatepkgs = solv_calloc(1, sizeof(Queue)); + queue_init(solv->cleandeps_updatepkgs); + } + queue_pushunique(solv->cleandeps_updatepkgs, p); +} + static void add_update_target(Solver *solv, Id p, Id how) { @@ -2627,6 +2678,8 @@ map_grow(&solv->bestupdatemap, installed->end - installed->start); MAPSET(&solv->bestupdatemap, pi - installed->start); } + if (how & SOLVER_CLEANDEPS) + add_cleandeps_package(solv, pi); queue_push2(solv->update_targets, pi, p); /* check if it's ok to keep the installed package */ if (s->evr == si->evr && solvable_identical(s, si)) @@ -2654,6 +2707,8 @@ map_grow(&solv->bestupdatemap, installed->end - installed->start); MAPSET(&solv->bestupdatemap, pi - installed->start); } + if (how & SOLVER_CLEANDEPS) + add_cleandeps_package(solv, pi); queue_push2(solv->update_targets, pi, p); } } @@ -2755,11 +2810,18 @@ queue_free(&solv->job); queue_init_clone(&solv->job, job); + /* free old stuff */ if (solv->update_targets) { queue_free(solv->update_targets); solv->update_targets = solv_free(solv->update_targets); } + if (solv->cleandeps_updatepkgs) + { + queue_free(solv->cleandeps_updatepkgs); + solv->cleandeps_updatepkgs = solv_free(solv->cleandeps_updatepkgs); + } + /* * create basic rule set of all involved packages * use addedmap bitmap to make sure we don't create rules twice @@ -2809,6 +2871,11 @@ solv->updatemap_all = 1; if (how & SOLVER_FORCEBEST) solv->bestupdatemap_all = 1; + if (how & SOLVER_CLEANDEPS) + { + FOR_REPO_SOLVABLES(installed, p, s) + add_cleandeps_package(solv, p); + } } else if (select == SOLVER_SOLVABLE_REPO) { @@ -2820,6 +2887,11 @@ solv->updatemap_all = 1; if (how & SOLVER_FORCEBEST) solv->bestupdatemap_all = 1; + if (how & SOLVER_CLEANDEPS) + { + FOR_REPO_SOLVABLES(installed, p, s) + add_cleandeps_package(solv, p); + } break; } if (solv->noautotarget && !(how & SOLVER_TARGETED)) @@ -2847,6 +2919,8 @@ map_grow(&solv->bestupdatemap, installed->end - installed->start); MAPSET(&solv->bestupdatemap, p - installed->start); } + if (how & SOLVER_CLEANDEPS) + add_cleandeps_package(solv, p); targeted = 0; } if (!targeted || solv->noautotarget) @@ -3034,11 +3108,6 @@ */ solv->jobrules = solv->nrules; - if (solv->cleandeps_updatepkgs) - { - queue_free(solv->cleandeps_updatepkgs); - solv->cleandeps_updatepkgs = solv_free(solv->cleandeps_updatepkgs); - } for (i = 0; i < job->count; i += 2) { oldnrules = solv->nrules; @@ -3132,37 +3201,6 @@ break; case SOLVER_UPDATE: - if ((how & SOLVER_CLEANDEPS) != 0 && installed) - { - if (how == SOLVER_SOLVABLE_ALL || (how == SOLVER_SOLVABLE_REPO && what == installed->repoid)) - { - FOR_REPO_SOLVABLES(installed, p, s) - { - if (!solv->cleandeps_updatepkgs) - { - solv->cleandeps_updatepkgs = solv_calloc(1, sizeof(Queue)); - queue_init(solv->cleandeps_updatepkgs); - } - queue_pushunique(solv->cleandeps_updatepkgs, p); - if (!solv->cleandepsmap.size) - map_grow(&solv->cleandepsmap, installed->end - installed->start); - } - } - FOR_JOB_SELECT(p, pp, select, what) - { - s = pool->solvables + p; - if (s->repo != installed) - continue; - if (!solv->cleandeps_updatepkgs) - { - solv->cleandeps_updatepkgs = solv_calloc(1, sizeof(Queue)); - queue_init(solv->cleandeps_updatepkgs); - } - queue_pushunique(solv->cleandeps_updatepkgs, p); - if (!solv->cleandepsmap.size) - map_grow(&solv->cleandepsmap, installed->end - installed->start); - } - } POOL_DEBUG(SOLV_DEBUG_JOB, "job: %supdate %s\n", weak ? "weak " : "", solver_select2str(pool, select, what)); break; case SOLVER_VERIFY: @@ -3298,6 +3336,16 @@ MAPSET(&solv->weakrulemap, p); } + /* enable cleandepsmap creation if we have updatepkgs */ + if (solv->cleandeps_updatepkgs && !solv->cleandepsmap.size) + map_grow(&solv->cleandepsmap, installed->end - installed->start); + /* no mistakes */ + if (solv->cleandeps_mistakes) + { + queue_free(solv->cleandeps_mistakes); + solv->cleandeps_mistakes = solv_free(solv->cleandeps_mistakes); + } + /* all new rules are learnt after this point */ solv->learntrules = solv->nrules; @@ -3317,13 +3365,6 @@ makeruledecisions(solv); POOL_DEBUG(SOLV_DEBUG_SOLVER, "problems so far: %d\n", solv->problems.count); - /* no mistakes */ - if (solv->cleandeps_mistakes) - { - queue_free(solv->cleandeps_mistakes); - solv->cleandeps_mistakes = solv_free(solv->cleandeps_mistakes); - } - /* * ******************************************** * solve! diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.2.1/test/testcases/cleandeps/cleandeps_dup.t new/libsolv-0.2.2/test/testcases/cleandeps/cleandeps_dup.t --- old/libsolv-0.2.1/test/testcases/cleandeps/cleandeps_dup.t 1970-01-01 01:00:00.000000000 +0100 +++ new/libsolv-0.2.2/test/testcases/cleandeps/cleandeps_dup.t 2012-12-05 14:38:04.000000000 +0100 @@ -0,0 +1,33 @@ +repo system 0 testtags <inline> +#>=Pkg: A 1 1 noarch +#>=Req: B1 +#>=Pkg: B1 1 1 noarch +repo test 0 testtags <inline> +#>=Pkg: A 1 2 noarch +#>=Req: B1 +#>=Pkg: A 2 1 noarch +#>=Req: B2 = 1 +#>=Pkg: B1 1 1 noarch +#>=Pkg: B2 1 1 noarch +system i686 rpm system + +# check untargeted +job distupgrade name A [cleandeps] +result transaction,problems <inline> +#>erase B1-1-1.noarch@system +#>install B2-1-1.noarch@test +#>upgrade A-1-1.noarch@system A-2-1.noarch@test + +# check targeted +nextjob +job distupgrade name A = 2 [cleandeps] +result transaction,problems <inline> +#>erase B1-1-1.noarch@system +#>install B2-1-1.noarch@test +#>upgrade A-1-1.noarch@system A-2-1.noarch@test + +# check targeted to 1-2 +nextjob +job distupgrade name A = 1-2 [cleandeps] +result transaction,problems <inline> +#>upgrade A-1-1.noarch@system A-1-2.noarch@test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.2.1/test/testcases/cleandeps/cleandeps_in.t new/libsolv-0.2.2/test/testcases/cleandeps/cleandeps_in.t --- old/libsolv-0.2.1/test/testcases/cleandeps/cleandeps_in.t 1970-01-01 01:00:00.000000000 +0100 +++ new/libsolv-0.2.2/test/testcases/cleandeps/cleandeps_in.t 2012-12-05 14:38:04.000000000 +0100 @@ -0,0 +1,15 @@ +repo system 0 testtags <inline> +#>=Pkg: A 1 1 noarch +#>=Req: B1 +#>=Pkg: B1 1 1 noarch +repo test 0 testtags <inline> +#>=Pkg: A 2 1 noarch +#>=Req: B2 = 1 +#>=Pkg: B1 1 1 noarch +#>=Pkg: B2 1 1 noarch +system i686 rpm system +job install name A = 2 [cleandeps] +result transaction,problems <inline> +#>erase B1-1-1.noarch@system +#>install B2-1-1.noarch@test +#>upgrade A-1-1.noarch@system A-2-1.noarch@test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.2.1/test/testcases/cleandeps/cleandeps_up.t new/libsolv-0.2.2/test/testcases/cleandeps/cleandeps_up.t --- old/libsolv-0.2.1/test/testcases/cleandeps/cleandeps_up.t 1970-01-01 01:00:00.000000000 +0100 +++ new/libsolv-0.2.2/test/testcases/cleandeps/cleandeps_up.t 2012-12-05 14:38:04.000000000 +0100 @@ -0,0 +1,33 @@ +repo system 0 testtags <inline> +#>=Pkg: A 1 1 noarch +#>=Req: B1 +#>=Pkg: B1 1 1 noarch +repo test 0 testtags <inline> +#>=Pkg: A 1 2 noarch +#>=Req: B1 +#>=Pkg: A 2 1 noarch +#>=Req: B2 = 1 +#>=Pkg: B1 1 1 noarch +#>=Pkg: B2 1 1 noarch +system i686 rpm system + +# check untargeted +job update name A [cleandeps] +result transaction,problems <inline> +#>erase B1-1-1.noarch@system +#>install B2-1-1.noarch@test +#>upgrade A-1-1.noarch@system A-2-1.noarch@test + +# check targeted +nextjob +job update name A = 2 [cleandeps] +result transaction,problems <inline> +#>erase B1-1-1.noarch@system +#>install B2-1-1.noarch@test +#>upgrade A-1-1.noarch@system A-2-1.noarch@test + +# check targeted to 1-2 +nextjob +job update name A = 1-2 [cleandeps] +result transaction,problems <inline> +#>upgrade A-1-1.noarch@system A-1-2.noarch@test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.2.1/test/testcases/cleandeps/mistake-packages.repo new/libsolv-0.2.2/test/testcases/cleandeps/mistake-packages.repo --- old/libsolv-0.2.1/test/testcases/cleandeps/mistake-packages.repo 2012-11-30 16:53:53.000000000 +0100 +++ new/libsolv-0.2.2/test/testcases/cleandeps/mistake-packages.repo 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -=Pkg: A 2 1 noarch -=Req: B = 1 -=Pkg: B 1 1 noarch diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.2.1/test/testcases/cleandeps/mistake-system.repo new/libsolv-0.2.2/test/testcases/cleandeps/mistake-system.repo --- old/libsolv-0.2.1/test/testcases/cleandeps/mistake-system.repo 2012-11-30 16:53:53.000000000 +0100 +++ new/libsolv-0.2.2/test/testcases/cleandeps/mistake-system.repo 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -=Pkg: A 1 1 noarch -=Req: B -=Pkg: B 2 1 noarch diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.2.1/test/testcases/cleandeps/mistake.t new/libsolv-0.2.2/test/testcases/cleandeps/mistake.t --- old/libsolv-0.2.1/test/testcases/cleandeps/mistake.t 2012-11-30 16:53:53.000000000 +0100 +++ new/libsolv-0.2.2/test/testcases/cleandeps/mistake.t 2012-12-05 14:38:04.000000000 +0100 @@ -1,5 +1,11 @@ -repo system 0 testtags mistake-system.repo -repo test 0 testtags mistake-packages.repo +repo system 0 testtags <inline> +#>=Pkg: A 1 1 noarch +#>=Req: B +#>=Pkg: B 2 1 noarch +repo test 0 testtags <inline> +#>=Pkg: A 2 1 noarch +#>=Req: B = 1 +#>=Pkg: B 1 1 noarch system i686 rpm system job install name A = 2 [cleandeps] result transaction,problems <inline> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.2.1/test/testcases/forcebest/forcebest_dup.t new/libsolv-0.2.2/test/testcases/forcebest/forcebest_dup.t --- old/libsolv-0.2.1/test/testcases/forcebest/forcebest_dup.t 1970-01-01 01:00:00.000000000 +0100 +++ new/libsolv-0.2.2/test/testcases/forcebest/forcebest_dup.t 2012-12-05 14:38:04.000000000 +0100 @@ -0,0 +1,31 @@ +repo system 0 testtags <inline> +#>=Pkg: A 1 1 noarch +#>=Vnd: foo +#>=Pkg: D 1 1 noarch +#>=Vnd: foo +#>=Con: A = 3-1 +repo available 0 testtags <inline> +#>=Pkg: A 2 1 noarch +#>=Vnd: foo +#>=Pkg: A 3 1 noarch +#>=Vnd: bar +system i686 rpm system + +job distupgrade name A [forcebest] +result transaction,problems <inline> +#>erase D-1-1.noarch@system +#>problem 1210fdfb info package D-1-1.noarch conflicts with A = 3-1 provided by A-3-1.noarch +#>problem 1210fdfb solution 0d75a914 erase D-1-1.noarch@system +#>problem 1210fdfb solution d85f7c4e allow A-2-1.noarch@available +#>upgrade A-1-1.noarch@system A-3-1.noarch@available + +# test if bestobeypolicy is a noop for dup jobs +nextjob +solverflags bestobeypolicy +job distupgrade name A [forcebest] +result transaction,problems <inline> +#>erase D-1-1.noarch@system +#>problem 1210fdfb info package D-1-1.noarch conflicts with A = 3-1 provided by A-3-1.noarch +#>problem 1210fdfb solution 0d75a914 erase D-1-1.noarch@system +#>problem 1210fdfb solution d85f7c4e allow A-2-1.noarch@available +#>upgrade A-1-1.noarch@system A-3-1.noarch@available diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.2.1/test/testcases/forcebest/forcebest_in.t new/libsolv-0.2.2/test/testcases/forcebest/forcebest_in.t --- old/libsolv-0.2.1/test/testcases/forcebest/forcebest_in.t 1970-01-01 01:00:00.000000000 +0100 +++ new/libsolv-0.2.2/test/testcases/forcebest/forcebest_in.t 2012-12-05 14:38:04.000000000 +0100 @@ -0,0 +1,29 @@ +repo system 0 testtags <inline> +#>=Pkg: D 1 1 noarch +#>=Vnd: foo +#>=Con: A = 3-1 +repo available 0 testtags <inline> +#>=Pkg: A 2 1 noarch +#>=Vnd: foo +#>=Pkg: A 3 1 noarch +#>=Vnd: bar +system i686 rpm system + +job install name A [forcebest] +result transaction,problems <inline> +#>erase D-1-1.noarch@system +#>install A-3-1.noarch@available +#>problem 1210fdfb info package D-1-1.noarch conflicts with A = 3-1 provided by A-3-1.noarch +#>problem 1210fdfb solution 0d75a914 erase D-1-1.noarch@system +#>problem 1210fdfb solution d85f7c4e deljob install name A [forcebest] + +# currently bestobeypolicy is a noop for install jobs +nextjob +solverflags bestobeypolicy +job install name A [forcebest] +result transaction,problems <inline> +#>erase D-1-1.noarch@system +#>install A-3-1.noarch@available +#>problem 1210fdfb info package D-1-1.noarch conflicts with A = 3-1 provided by A-3-1.noarch +#>problem 1210fdfb solution 0d75a914 erase D-1-1.noarch@system +#>problem 1210fdfb solution d85f7c4e deljob install name A [forcebest] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.2.1/test/testcases/forcebest/forcebest_up.t new/libsolv-0.2.2/test/testcases/forcebest/forcebest_up.t --- old/libsolv-0.2.1/test/testcases/forcebest/forcebest_up.t 1970-01-01 01:00:00.000000000 +0100 +++ new/libsolv-0.2.2/test/testcases/forcebest/forcebest_up.t 2012-12-05 14:38:04.000000000 +0100 @@ -0,0 +1,26 @@ +repo system 0 testtags <inline> +#>=Pkg: A 1 1 noarch +#>=Vnd: foo +#>=Pkg: D 1 1 noarch +#>=Vnd: foo +#>=Con: A = 3-1 +repo available 0 testtags <inline> +#>=Pkg: A 2 1 noarch +#>=Vnd: foo +#>=Pkg: A 3 1 noarch +#>=Vnd: bar +system i686 rpm system + +job update name A [forcebest] +result transaction,problems <inline> +#>problem 1210fdfb info package D-1-1.noarch conflicts with A = 3-1 provided by A-3-1.noarch +#>problem 1210fdfb solution 0d75a914 erase D-1-1.noarch@system +#>problem 1210fdfb solution 0d75a914 replace A-1-1.noarch@system A-3-1.noarch@available +#>problem 1210fdfb solution d85f7c4e allow A-2-1.noarch@available +#>upgrade A-1-1.noarch@system A-2-1.noarch@available + +nextjob +solverflags bestobeypolicy +job update name A [forcebest] +result transaction,problems <inline> +#>upgrade A-1-1.noarch@system A-2-1.noarch@available diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.2.1/test/testcases/targeted/targeted_dup.t new/libsolv-0.2.2/test/testcases/targeted/targeted_dup.t --- old/libsolv-0.2.1/test/testcases/targeted/targeted_dup.t 2012-11-30 16:53:53.000000000 +0100 +++ new/libsolv-0.2.2/test/testcases/targeted/targeted_dup.t 2012-12-05 14:38:04.000000000 +0100 @@ -1,46 +1,16 @@ repo system 0 testtags <inline> #>=Pkg: A 1 1 noarch -#>+Prv: -#>A = 1-1 -#>-Prv: #>=Pkg: D 1 1 noarch -#>+Prv: -#>D = 1-1 -#>-Prv: #>=Pkg: Z 1 1 noarch -#>+Prv: -#>Z = 1-1 -#>-Prv: -#>+Con: -#>D = 2-1 -#>-Con: +#>=Con: D = 2-1 repo available 0 testtags <inline> #>=Pkg: A 2 1 noarch -#>+Prv: -#>A = 2-1 -#>-Prv: #>=Pkg: B 1 0 noarch -#>+Prv: -#>B = 1-0 -#>-Prv: -#>+Obs: -#>A -#>-Obs: +#>=Obs: A #>=Pkg: C 1 0 noarch -#>+Prv: -#>C = 1-0 -#>-Prv: -#>+Obs: -#>A = 1-1 -#>-Obs: +#>=Obs: A = 1-1 #>=Pkg: D 2 1 noarch -#>+Prv: -#>D = 2-1 -#>-Prv: #>=Pkg: D 3 1 noarch -#>+Prv: -#>D = 3-1 -#>-Prv: system i686 rpm system # first check untargeted diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.2.1/test/testcases/targeted/targeted_up.t new/libsolv-0.2.2/test/testcases/targeted/targeted_up.t --- old/libsolv-0.2.1/test/testcases/targeted/targeted_up.t 2012-11-30 16:53:53.000000000 +0100 +++ new/libsolv-0.2.2/test/testcases/targeted/targeted_up.t 2012-12-05 14:38:04.000000000 +0100 @@ -1,46 +1,16 @@ repo system 0 testtags <inline> #>=Pkg: A 1 1 noarch -#>+Prv: -#>A = 1-1 -#>-Prv: #>=Pkg: D 1 1 noarch -#>+Prv: -#>D = 1-1 -#>-Prv: #>=Pkg: Z 1 1 noarch -#>+Prv: -#>Z = 1-1 -#>-Prv: -#>+Con: -#>D = 2-1 -#>-Con: +#>=Con: D = 2-1 repo available 0 testtags <inline> #>=Pkg: A 2 1 noarch -#>+Prv: -#>A = 2-1 -#>-Prv: #>=Pkg: B 1 0 noarch -#>+Prv: -#>B = 1-0 -#>-Prv: -#>+Obs: -#>A -#>-Obs: +#>=Obs: A #>=Pkg: C 1 0 noarch -#>+Prv: -#>C = 1-0 -#>-Prv: -#>+Obs: -#>A = 1-1 -#>-Obs: +#>=Obs: A = 1-1 #>=Pkg: D 2 1 noarch -#>+Prv: -#>D = 2-1 -#>-Prv: #>=Pkg: D 3 1 noarch -#>+Prv: -#>D = 3-1 -#>-Prv: system i686 rpm system # first check untargeted diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.2.1/tools/testsolv.c new/libsolv-0.2.2/tools/testsolv.c --- old/libsolv-0.2.1/tools/testsolv.c 2012-11-30 16:53:53.000000000 +0100 +++ new/libsolv-0.2.2/tools/testsolv.c 2012-12-05 14:38:04.000000000 +0100 @@ -8,6 +8,18 @@ #include "solverdebug.h" #include "testcase.h" +static struct resultflags2str { + Id flag; + const char *str; +} resultflags2str[] = { + { TESTCASE_RESULT_TRANSACTION, "transaction" }, + { TESTCASE_RESULT_PROBLEMS, "problems" }, + { TESTCASE_RESULT_ORPHANED, "orphaned" }, + { TESTCASE_RESULT_RECOMMENDED, "recommended" }, + { TESTCASE_RESULT_UNNEEDED, "unneeded" }, + { 0, 0 } +}; + static void usage(ex) { @@ -91,10 +103,22 @@ { if (writeresult > 1) { - char *p = myresult; + const char *p; + int i; + + printf("result "); + p = "%s"; + for (i = 0; resultflags2str[i].str; i++) + if ((resultflags & resultflags2str[i].flag) != 0) + { + printf(p, resultflags2str[i].str); + p = ",%s"; + } + printf(" <inline>\n"); + p = myresult; while (*p) { - char *p2 = strchr(p, '\n'); + const char *p2 = strchr(p, '\n'); p2 = p2 ? p2 + 1 : p + strlen(p); printf("#>%.*s", (int)(p2 - p), p); p = p2; -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org