]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Rename selection_make_containsdep to selection_make_matchdepid
authorMichael Schroeder <mls@suse.de>
Fri, 22 Apr 2016 13:52:02 +0000 (15:52 +0200)
committerMichael Schroeder <mls@suse.de>
Fri, 22 Apr 2016 13:52:02 +0000 (15:52 +0200)
And support SELECTION_MATCH_DEPSTR for exact id match

src/libsolv.ver
src/selection.c
src/selection.h

index 531eaa182ddfd90707a72047259e4fab413be5d4..a5efd6ae39f0322d97f930997f90e21a4526bb6e 100644 (file)
@@ -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;
index 12bc46428197a1084f89722a1ab7eabe7bc3882f..34e08a9adc4f67c99fbec6e64577deb5e95a859a 100644 (file)
@@ -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)
index 29189a351c91637d3246758590b9b8d900a3bfe6..0dd61500877504f29cc50b0974801d37a30fa0ed 100644 (file)
@@ -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);