diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2018-11-30 12:40:15 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2018-11-30 12:40:16 +0900 |
commit | 51a3a2ac14ea0b18ccbe47ce771d5c962aa0800a (patch) | |
tree | 778194706f6f8a417899f6070be7308107bc92bb /bindings | |
parent | 22e701e553344eeb22f88ed0906d76c9a5e39d83 (diff) | |
download | libsolv-51a3a2ac14ea0b18ccbe47ce771d5c962aa0800a.tar.gz libsolv-51a3a2ac14ea0b18ccbe47ce771d5c962aa0800a.tar.bz2 libsolv-51a3a2ac14ea0b18ccbe47ce771d5c962aa0800a.zip |
Imported Upstream version 0.6.25upstream/0.6.25
Change-Id: I4c41182d0968927b2dc78980b41c0b7c2e931a4a
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'bindings')
-rw-r--r-- | bindings/solv.i | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/bindings/solv.i b/bindings/solv.i index 64f51d0..61dc640 100644 --- a/bindings/solv.i +++ b/bindings/solv.i @@ -2188,6 +2188,34 @@ rb_eval_string( } #endif + Repo *createshadow(const char *name) { + Repo *repo = repo_create($self->pool, name); + if ($self->idarraysize) { + repo_reserve_ids(repo, 0, $self->idarraysize); + memcpy(repo->idarraydata, $self->idarraydata, sizeof(Id) * $self->idarraysize); + repo->idarraysize = $self->idarraysize; + } + repo->start = $self->start; + repo->end = $self->end; + repo->nsolvables = $self->nsolvables; + return repo; + } + + void moveshadow(Queue q) { + Pool *pool = $self->pool; + int i; + for (i = 0; i < q.count; i++) { + Solvable *s; + Id p = q.elements[i]; + if (p < $self->start || p >= $self->end) + continue; + s = pool->solvables + p; + if ($self->idarraysize != s->repo->idarraysize) + continue; + s->repo = $self; + } + } + #if defined(SWIGTCL) %rename("==") __eq__; #endif @@ -2963,6 +2991,12 @@ rb_eval_string( int evrcmp(XSolvable *s2) { return pool_evrcmp($self->pool, $self->pool->solvables[$self->id].evr, s2->pool->solvables[s2->id].evr, EVRCMP_COMPARE); } +#ifdef SWIGRUBY + %rename("matchesdep?") matchesdep; +#endif + bool matchesdep(Id keyname, DepId id, Id marker = -1) { + return solvable_matchesdep($self->pool->solvables + $self->id, keyname, id, marker); + } #if defined(SWIGTCL) %rename("==") __eq__; @@ -3281,6 +3315,8 @@ rb_eval_string( static const int SOLVER_FLAG_YUM_OBSOLETES = SOLVER_FLAG_YUM_OBSOLETES; static const int SOLVER_FLAG_NEED_UPDATEPROVIDE = SOLVER_FLAG_NEED_UPDATEPROVIDE; static const int SOLVER_FLAG_FOCUS_BEST = SOLVER_FLAG_FOCUS_BEST; + static const int SOLVER_FLAG_STRONG_RECOMMENDS = SOLVER_FLAG_STRONG_RECOMMENDS; + static const int SOLVER_FLAG_INSTALL_ALSO_UPDATES = SOLVER_FLAG_INSTALL_ALSO_UPDATES; static const int SOLVER_REASON_UNRELATED = SOLVER_REASON_UNRELATED; static const int SOLVER_REASON_UNIT_RULE = SOLVER_REASON_UNIT_RULE; @@ -3451,6 +3487,21 @@ rb_eval_string( bool write_testcase(const char *dir) { return testcase_write($self, dir, TESTCASE_RESULT_TRANSACTION | TESTCASE_RESULT_PROBLEMS, 0, 0); } + + Queue raw_decisions(int filter=0) { + Queue q; + queue_init(&q); + solver_get_decisionqueue($self, &q); + if (filter) { + int i, j; + for (i = j = 0; i < q.count; i++) + if ((filter > 0 && q.elements[i] > 1) || + (filter < 0 && q.elements[i] < 0)) + q.elements[j++] = q.elements[i]; + queue_truncate(&q, j); + } + return q; + } } %extend Transaction { |