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);
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;
}
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);
}
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;
}
if hasattr(repo, 'handle'):
if not repofilter:
repofilter = pool.Selection()
- repofilter.add_raw(Job.SOLVER_SOLVABLE_REPO|Job.SOLVER_SETREPO|Job.SOLVER_SETVENDOR, repo.handle.id)
+ repofilter.add(repo.handle.Selection(Job.SOLVER_SETVENDOR))
if cmd == 'search':
pool.createwhatprovides()
jobs += sel.jobs(cmdactionmap[cmd])
if not jobs and (cmd == 'up' or cmd == 'dup' or cmd == 'verify' or repofilter):
- sel = pool.Selection()
- sel.add_raw(Job.SOLVER_SOLVABLE_ALL, 0)
+ sel = pool.Selection_all()
if repofilter:
sel.filter(repofilter)
jobs += sel.jobs(cmdactionmap[cmd])