summaryrefslogtreecommitdiff
path: root/bindings
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2013-09-04 11:45:26 +0200
committerMichael Schroeder <mls@suse.de>2013-09-04 11:45:26 +0200
commiteb15c1e5a6b64178abbbb5a6b58c8b65c9f27358 (patch)
tree155963609a732e1c63f7a820fade96efdf1d8f7a /bindings
parent5f216e7248a2c16146f4f86d99812e109655314e (diff)
downloadlibsolv-eb15c1e5a6b64178abbbb5a6b58c8b65c9f27358.tar.gz
libsolv-eb15c1e5a6b64178abbbb5a6b58c8b65c9f27358.tar.bz2
libsolv-eb15c1e5a6b64178abbbb5a6b58c8b65c9f27358.zip
add solv_depmarker function to simplify the bindings
Diffstat (limited to 'bindings')
-rw-r--r--bindings/solv.i30
1 files changed, 2 insertions, 28 deletions
diff --git a/bindings/solv.i b/bindings/solv.i
index 23dfdf1..7c0db0a 100644
--- a/bindings/solv.i
+++ b/bindings/solv.i
@@ -2151,14 +2151,6 @@ rb_eval_string(
Solvable *s = $self->pool->solvables + $self->id;
Queue r;
queue_init(&r);
- if (marker == -1 || marker == 1) {
- if (keyname == SOLVABLE_PROVIDES)
- marker = marker < 0 ? -SOLVABLE_FILEMARKER : SOLVABLE_FILEMARKER;
- else if (keyname == SOLVABLE_REQUIRES)
- marker = marker < 0 ? -SOLVABLE_PREREQMARKER : SOLVABLE_PREREQMARKER;
- else
- marker = 0;
- }
solvable_lookup_deparray(s, keyname, &r, marker);
return r;
}
@@ -2168,14 +2160,6 @@ rb_eval_string(
Solvable *s = $self->pool->solvables + $self->id;
Queue r;
queue_init(&r);
- if (marker == -1 || marker == 1) {
- if (keyname == SOLVABLE_PROVIDES)
- marker = marker < 0 ? -SOLVABLE_FILEMARKER : SOLVABLE_FILEMARKER;
- else if (keyname == SOLVABLE_REQUIRES)
- marker = marker < 0 ? -SOLVABLE_PREREQMARKER : SOLVABLE_PREREQMARKER;
- else
- marker = 0;
- }
solvable_lookup_deparray(s, keyname, &r, marker);
return r;
}
@@ -2290,8 +2274,7 @@ rb_eval_string(
/* old interface, please use the generic add_deparray instead */
void add_provides(DepId id, Id marker = -1) {
Solvable *s = $self->pool->solvables + $self->id;
- if (marker == -1 || marker == 1)
- marker = marker < 0 ? -SOLVABLE_FILEMARKER : SOLVABLE_FILEMARKER;
+ marker = solv_depmarker(SOLVABLE_PROVIDES, marker);
s->provides = repo_addid_dep(s->repo, s->provides, id, marker);
}
void add_obsoletes(DepId id) {
@@ -2304,8 +2287,7 @@ rb_eval_string(
}
void add_requires(DepId id, Id marker = -1) {
Solvable *s = $self->pool->solvables + $self->id;
- if (marker == -1 || marker == 1)
- marker = marker < 0 ? -SOLVABLE_PREREQMARKER : SOLVABLE_PREREQMARKER;
+ marker = solv_depmarker(SOLVABLE_REQUIRES, marker);
s->requires = repo_addid_dep(s->repo, s->requires, id, marker);
}
void add_recommends(DepId id) {
@@ -2332,14 +2314,6 @@ rb_eval_string(
void add_deparray(Id keyname, DepId id, Id marker = -1) {
Solvable *s = $self->pool->solvables + $self->id;
- if (marker == -1 || marker == 1) {
- if (keyname == SOLVABLE_PROVIDES)
- marker = marker < 0 ? -SOLVABLE_FILEMARKER : SOLVABLE_FILEMARKER;
- else if (keyname == SOLVABLE_REQUIRES)
- marker = marker < 0 ? -SOLVABLE_PREREQMARKER : SOLVABLE_PREREQMARKER;
- else
- marker = 0;
- }
solvable_add_deparray(s, keyname, id, marker);
}