summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/solv.c9
-rw-r--r--src/libsolv.ver3
-rw-r--r--src/pool.c14
-rw-r--r--src/pool.h7
-rw-r--r--src/selection.c4
-rw-r--r--src/selection.h2
-rw-r--r--src/solvable.c4
-rw-r--r--src/solvable.h2
8 files changed, 31 insertions, 14 deletions
diff --git a/examples/solv.c b/examples/solv.c
index d4a6b6c..1ab0d88 100644
--- a/examples/solv.c
+++ b/examples/solv.c
@@ -2880,7 +2880,7 @@ main(int argc, char **argv)
if (!keyname)
rflags = selection_make(pool, &job2, argv[i], flags);
else
- rflags = selection_make_deps(pool, &job2, argv[i], flags, pool_str2id(pool, keyname, 1));
+ rflags = selection_make_matchdeps(pool, &job2, argv[i], flags, pool_str2id(pool, keyname, 1), 0);
if (repofilter.count)
selection_filter(pool, &job2, &repofilter);
if (!job2.count)
@@ -2889,7 +2889,7 @@ main(int argc, char **argv)
if (!keyname)
rflags = selection_make(pool, &job2, argv[i], flags);
else
- rflags = selection_make_deps(pool, &job2, argv[i], flags, pool_str2id(pool, keyname, 1));
+ rflags = selection_make_matchdeps(pool, &job2, argv[i], flags, pool_str2id(pool, keyname, 1), 0);
if (repofilter.count)
selection_filter(pool, &job2, &repofilter);
if (job2.count)
@@ -2949,6 +2949,11 @@ main(int argc, char **argv)
str = solvable_lookup_str(s, SOLVABLE_LICENSE);
if (str)
printf("License: %s\n", str);
+#if 0
+ str = solvable_lookup_sourcepkg(s);
+ if (str)
+ printf("Source: %s\n", str);
+#endif
printf("Description:\n%s\n", solvable_lookup_str(s, SOLVABLE_DESCRIPTION));
printf("\n");
}
diff --git a/src/libsolv.ver b/src/libsolv.ver
index 86ca660..555b676 100644
--- a/src/libsolv.ver
+++ b/src/libsolv.ver
@@ -73,6 +73,7 @@ SOLV_1.0 {
pool_id2langid;
pool_id2rel;
pool_id2str;
+ pool_intersect_evrs;
pool_isemptyupdatejob;
pool_job2solvables;
pool_job2str;
@@ -240,7 +241,7 @@ SOLV_1.0 {
selection_add;
selection_filter;
selection_make;
- selection_make_deps;
+ selection_make_matchdeps;
selection_solvables;
solv_bin2hex;
solv_calloc;
diff --git a/src/pool.c b/src/pool.c
index 437e53d..6f790ff 100644
--- a/src/pool.c
+++ b/src/pool.c
@@ -591,6 +591,7 @@ pool_queuetowhatprovides(Pool *pool, Queue *q)
#endif
/* check if a package's nevr matches a dependency */
+/* semi-private, called from public pool_match_nevr */
int
pool_match_nevr_rel(Pool *pool, Solvable *s, Id d)
@@ -707,6 +708,13 @@ pool_match_flags_evr_rel_compat(Pool *pool, Reldep *range, int flags, int evr)
}
#endif
+/* public (i.e. not inlined) version of pool_match_flags_evr */
+int
+pool_intersect_evrs(Pool *pool, int pflags, Id pevr, int flags, int evr)
+{
+ return pool_match_flags_evr(pool, pflags, pevr, flags, evr);
+}
+
/* match two dependencies (d1 = provider) */
int
@@ -733,7 +741,7 @@ pool_match_dep(Pool *pool, Id d1, Id d2)
if (!pool_match_dep(pool, rd1->name, rd2->name))
return 0;
/* name matches, check flags and evr */
- return pool_match_flags_evr(pool, rd1->flags, rd1->evr, rd2->flags, rd2->evr);
+ return pool_intersect_evrs(pool, rd1->flags, rd1->evr, rd2->flags, rd2->evr);
}
Id
@@ -1067,7 +1075,7 @@ pool_flush_namespaceproviders(Pool *pool, Id ns, Id evr)
/* intersect dependencies in keyname with dep, return list of matching packages */
void
-pool_whatmatchesdep(Pool *pool, Id keyname, Id dep, Queue *q)
+pool_whatmatchesdep(Pool *pool, Id keyname, Id dep, Queue *q, int marker)
{
Id p;
@@ -1079,7 +1087,7 @@ pool_whatmatchesdep(Pool *pool, Id keyname, Id dep, Queue *q)
continue;
if (s->repo != pool->installed && !pool_installable(pool, s))
continue;
- if (solvable_matchesdep(s, keyname, dep))
+ if (solvable_matchesdep(s, keyname, dep, marker))
queue_push(q, p);
}
}
diff --git a/src/pool.h b/src/pool.h
index c0fdc3a..eb1a9ac 100644
--- a/src/pool.h
+++ b/src/pool.h
@@ -283,9 +283,12 @@ int solvable_is_irrelevant_patch(Solvable *s, Map *installedmap);
void pool_create_state_maps(Pool *pool, Queue *installed, Map *installedmap, Map *conflictsmap);
-int pool_match_nevr_rel(Pool *pool, Solvable *s, Id d);
+int pool_intersect_evrs(Pool *pool, int pflags, Id pevr, int flags, int evr);
int pool_match_dep(Pool *pool, Id d1, Id d2);
+/* semi private, used in pool_match_nevr */
+int pool_match_nevr_rel(Pool *pool, Solvable *s, Id d);
+
static inline int pool_match_nevr(Pool *pool, Solvable *s, Id d)
{
if (!ISRELDEP(d))
@@ -329,7 +332,7 @@ static inline Id *pool_whatprovides_ptr(Pool *pool, Id d)
return pool->whatprovidesdata + off;
}
-void pool_whatmatchesdep(Pool *pool, Id keyname, Id dep, Queue *q);
+void pool_whatmatchesdep(Pool *pool, Id keyname, Id dep, Queue *q, int marker);
/* search the pool. the following filters are available:
* p - search just this solvable
diff --git a/src/selection.c b/src/selection.c
index 2e6e82d..a2dd31b 100644
--- a/src/selection.c
+++ b/src/selection.c
@@ -891,7 +891,7 @@ matchdep(Pool *pool, Id id, char *rname, int rflags, char *revr, int flags)
* deps in keyname instead of provides.
*/
int
-selection_make_deps(Pool *pool, Queue *selection, const char *name, int flags, int keyname)
+selection_make_matchdeps(Pool *pool, Queue *selection, const char *name, int flags, int keyname, int marker)
{
char *rname, *r;
int rflags = 0;
@@ -929,7 +929,7 @@ selection_make_deps(Pool *pool, Queue *selection, const char *name, int flags, i
if ((s->arch == ARCH_SRC || s->arch == ARCH_NOSRC) && !(flags & SELECTION_SOURCE_ONLY) && !(flags & SELECTION_WITH_SOURCE))
continue;
queue_empty(&q);
- repo_lookup_idarray(s->repo, p, keyname, &q);
+ repo_lookup_deparray(s->repo, p, keyname, &q, marker);
for (i = 0; i < q.count; i++)
{
Id id = q.elements[i];
diff --git a/src/selection.h b/src/selection.h
index e1da169..8f4d04b 100644
--- a/src/selection.h
+++ b/src/selection.h
@@ -34,7 +34,7 @@ extern "C" {
#define SELECTION_WITH_SOURCE (1 << 13)
extern int selection_make(Pool *pool, Queue *selection, const char *name, int flags);
-extern int selection_make_deps(Pool *pool, Queue *selection, const char *name, int flags, int keyname);
+extern int selection_make_matchdeps(Pool *pool, Queue *selection, const char *name, 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);
diff --git a/src/solvable.c b/src/solvable.c
index b822784..bfe25ce 100644
--- a/src/solvable.c
+++ b/src/solvable.c
@@ -859,13 +859,13 @@ solvable_unset(Solvable *s, Id keyname)
/* return true if a dependency intersects dep in the keyname array */
int
-solvable_matchesdep(Solvable *s, Id keyname, Id dep)
+solvable_matchesdep(Solvable *s, Id keyname, Id dep, int marker)
{
int i;
Pool *pool = s->repo->pool;
Queue q;
queue_init(&q);
- solvable_lookup_idarray(s, keyname, &q);
+ solvable_lookup_deparray(s, keyname, &q, marker);
for (i = 0; i < q.count; i++)
if (pool_match_dep(pool, q.elements[i], dep))
break;
diff --git a/src/solvable.h b/src/solvable.h
index 356e7d6..0407997 100644
--- a/src/solvable.h
+++ b/src/solvable.h
@@ -78,7 +78,7 @@ void solvable_unset(Solvable *s, Id keyname);
int solvable_identical(Solvable *s1, Solvable *s2);
Id solvable_selfprovidedep(Solvable *s);
-int solvable_matchesdep(Solvable *s, Id keyname, Id dep);
+int solvable_matchesdep(Solvable *s, Id keyname, Id dep, int marker);
#ifdef __cplusplus
}