From: Michael Schroeder Date: Fri, 22 Apr 2016 13:52:02 +0000 (+0200) Subject: Rename selection_make_containsdep to selection_make_matchdepid X-Git-Tag: 0.6.21~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1ea279e00305f592f3dd838fb9696b06c0119e7;p=thirdparty%2Flibsolv.git Rename selection_make_containsdep to selection_make_matchdepid And support SELECTION_MATCH_DEPSTR for exact id match --- diff --git a/src/libsolv.ver b/src/libsolv.ver index 531eaa18..a5efd6ae 100644 --- a/src/libsolv.ver +++ b/src/libsolv.ver @@ -246,7 +246,7 @@ SOLV_1.0 { selection_add; selection_filter; selection_make; - selection_make_containsdep; + selection_make_matchdepid; selection_make_matchdeps; selection_solvables; solv_bin2hex; diff --git a/src/selection.c b/src/selection.c index 12bc4642..34e08a9a 100644 --- a/src/selection.c +++ b/src/selection.c @@ -988,7 +988,7 @@ selection_make_matchdeps(Pool *pool, Queue *selection, const char *name, int fla } int -selection_make_containsdep(Pool *pool, Queue *selection, Id dep, int flags, int keyname, int marker) +selection_make_matchdepid(Pool *pool, Queue *selection, Id dep, int flags, int keyname, int marker) { Id p; Queue q; @@ -1017,7 +1017,13 @@ selection_make_containsdep(Pool *pool, Queue *selection, Id dep, int flags, int repo_lookup_deparray(s->repo, p, keyname, &q, marker); for (i = 0; i < q.count; i++) { - if (q.elements[i] == dep) + if ((flags & SELECTION_MATCH_DEPSTR) != 0) /* mis-use */ + { + if (q.elements[i] == dep) + break; + continue; + } + if (pool_match_dep(pool, q.elements[i], dep)) break; } if (i < q.count) diff --git a/src/selection.h b/src/selection.h index 29189a35..0dd61500 100644 --- a/src/selection.h +++ b/src/selection.h @@ -37,7 +37,7 @@ extern "C" { extern int selection_make(Pool *pool, Queue *selection, const char *name, int flags); extern int selection_make_matchdeps(Pool *pool, Queue *selection, const char *name, int flags, int keyname, int marker); -extern int selection_make_containsdep(Pool *pool, Queue *selection, Id dep, int flags, int keyname, int marker); +extern int selection_make_matchdepid(Pool *pool, Queue *selection, Id dep, int flags, int keyname, int marker); extern void selection_filter(Pool *pool, Queue *sel1, Queue *sel2); extern void selection_add(Pool *pool, Queue *sel1, Queue *sel2);