From 986388915b1ac9486c47b406363d3d9c881c07e4 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Fri, 1 Aug 2025 15:35:01 +0200 Subject: [PATCH] Rename pool_dep_fulfilled_in_map to pool_satisfieddep_map This is more similar to the other functions we already have. --- doc/gen/libsolv-bindings.3 | 4 ++-- doc/gen/libsolv-pool.3 | 16 ++++++++++++++-- doc/libsolv-pool.txt | 6 +++--- src/libsolv.ver | 2 +- src/pool.h | 4 +++- src/pooldep.c | 34 +++++++++++++++++----------------- 6 files changed, 40 insertions(+), 26 deletions(-) diff --git a/doc/gen/libsolv-bindings.3 b/doc/gen/libsolv-bindings.3 index ea935a80..78f33c0a 100644 --- a/doc/gen/libsolv-bindings.3 +++ b/doc/gen/libsolv-bindings.3 @@ -2,12 +2,12 @@ .\" Title: Libsolv-Bindings .\" Author: [see the "Author" section] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 07/29/2025 +.\" Date: 08/01/2025 .\" Manual: LIBSOLV .\" Source: libsolv .\" Language: English .\" -.TH "LIBSOLV\-BINDINGS" "3" "07/29/2025" "libsolv" "LIBSOLV" +.TH "LIBSOLV\-BINDINGS" "3" "08/01/2025" "libsolv" "LIBSOLV" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/doc/gen/libsolv-pool.3 b/doc/gen/libsolv-pool.3 index 52ae6268..b75aa6fe 100644 --- a/doc/gen/libsolv-pool.3 +++ b/doc/gen/libsolv-pool.3 @@ -2,12 +2,12 @@ .\" Title: Libsolv-Pool .\" Author: [see the "Author" section] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 03/25/2024 +.\" Date: 08/01/2025 .\" Manual: LIBSOLV .\" Source: libsolv .\" Language: English .\" -.TH "LIBSOLV\-POOL" "3" "03/25/2024" "libsolv" "LIBSOLV" +.TH "LIBSOLV\-POOL" "3" "08/01/2025" "libsolv" "LIBSOLV" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -878,6 +878,18 @@ Returns \(lq1\(rq if the dependency \fId1\fR (the provider) is matched by the de .\} .sp Like pool_match_dep, but the provider is the "self\-provides" dependency of the Solvable \fIs\fR, i\&.e\&. the dependency \(lqs→name = s→evr\(rq\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +\fBint pool_satisfieddep_map(Pool *\fR\fIpool\fR\fB, const Map *\fR\fImap\fR\fB, Id\fR \fIdep\fR\fB)\fR; +.fi +.if n \{\ +.RE +.\} +.sp +Returns \(lq1\(rq if the dependency \fIdep\fR is satisfied by the packages specified in \fImap\fR, otherwise \(lq0\(rq is returned\&. .SH "WHATPROVIDES INDEX" .sp .if n \{\ diff --git a/doc/libsolv-pool.txt b/doc/libsolv-pool.txt index 92232ab1..658f588e 100644 --- a/doc/libsolv-pool.txt +++ b/doc/libsolv-pool.txt @@ -562,10 +562,10 @@ by the ``evr'' parts must overlap. Like pool_match_dep, but the provider is the "self-provides" dependency of the Solvable _s_, i.e. the dependency ``s->name = s->evr''. - int pool_dep_fulfilled_in_map(Pool *pool, const Map *map, Id dep); + int pool_satisfieddep_map(Pool *pool, const Map *map, Id dep); -Returns ``1'' if the dependency _dep_ is provided by at least one package -from _map_, otherwise ``0'' is returned. +Returns ``1'' if the dependency _dep_ is satisfied by the packages specified +in _map_, otherwise ``0'' is returned. Whatprovides Index ------------------ diff --git a/src/libsolv.ver b/src/libsolv.ver index 6f72ae16..d1e4f83e 100644 --- a/src/libsolv.ver +++ b/src/libsolv.ver @@ -91,12 +91,12 @@ SOLV_1.0 { pool_lookup_str; pool_lookup_void; pool_match_dep; - pool_dep_fulfilled_in_map; pool_match_nevr_rel; pool_prepend_rootdir; pool_prepend_rootdir_tmp; pool_queuetowhatprovides; pool_rel2id; + pool_satisfieddep_map; pool_search; pool_selection2str; pool_set_custom_vendorcheck; diff --git a/src/pool.h b/src/pool.h index 861d0ca0..fa96be2c 100644 --- a/src/pool.h +++ b/src/pool.h @@ -305,7 +305,8 @@ Id pool_id2langid(Pool *pool, Id id, const char *lang, int create); int pool_intersect_evrs(Pool *pool, int pflags, Id pevr, int flags, Id evr); int pool_match_dep(Pool *pool, Id d1, Id d2); -int pool_dep_fulfilled_in_map(Pool *pool, const Map *map, Id dep); +int pool_satisfieddep_map(Pool *pool, const Map *map, Id dep); + /* semi private, used in pool_match_nevr */ int pool_match_nevr_rel(Pool *pool, Solvable *s, Id d); @@ -357,6 +358,7 @@ static inline Id *pool_whatprovides_ptr(Pool *pool, Id d) void pool_whatmatchesdep(Pool *pool, Id keyname, Id dep, Queue *q, int marker); void pool_whatcontainsdep(Pool *pool, Id keyname, Id dep, Queue *q, int marker); void pool_whatmatchessolvable(Pool *pool, Id keyname, Id solvid, Queue *q, int marker); + void pool_set_whatprovides(Pool *pool, Id id, Id providers); void pool_add_new_provider(Pool *pool, Id id, Id p); diff --git a/src/pooldep.c b/src/pooldep.c index e7ff68c8..a3dff32d 100644 --- a/src/pooldep.c +++ b/src/pooldep.c @@ -346,7 +346,7 @@ pool_whatmatchessolvable(Pool *pool, Id keyname, Id solvid, Queue *q, int marker } static int -pool_dep_fulfilled_in_map_cplx(Pool *pool, const Map *map, Reldep *rd) +pool_satisfieddep_map_cplx(Pool *pool, const Map *map, Reldep *rd) { if (rd->flags == REL_COND) { @@ -355,14 +355,14 @@ pool_dep_fulfilled_in_map_cplx(Pool *pool, const Map *map, Reldep *rd) Reldep *rd2 = GETRELDEP(pool, rd->evr); if (rd2->flags == REL_ELSE) { - if (pool_dep_fulfilled_in_map(pool, map, rd2->name)) - return pool_dep_fulfilled_in_map(pool, map, rd->name); - return pool_dep_fulfilled_in_map(pool, map, rd2->evr); + if (pool_satisfieddep_map(pool, map, rd2->name)) + return pool_satisfieddep_map(pool, map, rd->name); + return pool_satisfieddep_map(pool, map, rd2->evr); } } - if (pool_dep_fulfilled_in_map(pool, map, rd->name)) + if (pool_satisfieddep_map(pool, map, rd->name)) return 1; - return !pool_dep_fulfilled_in_map(pool, map, rd->evr); + return !pool_satisfieddep_map(pool, map, rd->evr); } if (rd->flags == REL_UNLESS) { @@ -371,32 +371,32 @@ pool_dep_fulfilled_in_map_cplx(Pool *pool, const Map *map, Reldep *rd) Reldep *rd2 = GETRELDEP(pool, rd->evr); if (rd2->flags == REL_ELSE) { - if (!pool_dep_fulfilled_in_map(pool, map, rd2->name)) - return pool_dep_fulfilled_in_map(pool, map, rd->name); - return pool_dep_fulfilled_in_map(pool, map, rd2->evr); + if (!pool_satisfieddep_map(pool, map, rd2->name)) + return pool_satisfieddep_map(pool, map, rd->name); + return pool_satisfieddep_map(pool, map, rd2->evr); } } - if (!pool_dep_fulfilled_in_map(pool, map, rd->name)) + if (!pool_satisfieddep_map(pool, map, rd->name)) return 0; - return !pool_dep_fulfilled_in_map(pool, map, rd->evr); + return !pool_satisfieddep_map(pool, map, rd->evr); } if (rd->flags == REL_AND) { - if (!pool_dep_fulfilled_in_map(pool, map, rd->name)) + if (!pool_satisfieddep_map(pool, map, rd->name)) return 0; - return pool_dep_fulfilled_in_map(pool, map, rd->evr); + return pool_satisfieddep_map(pool, map, rd->evr); } if (rd->flags == REL_OR) { - if (pool_dep_fulfilled_in_map(pool, map, rd->name)) + if (pool_satisfieddep_map(pool, map, rd->name)) return 1; - return pool_dep_fulfilled_in_map(pool, map, rd->evr); + return pool_satisfieddep_map(pool, map, rd->evr); } return 0; } int -pool_dep_fulfilled_in_map(Pool *pool, const Map *map, Id dep) +pool_satisfieddep_map(Pool *pool, const Map *map, Id dep) { Id p, pp; @@ -404,7 +404,7 @@ pool_dep_fulfilled_in_map(Pool *pool, const Map *map, Id dep) Reldep *rd = GETRELDEP(pool, dep); if (rd->flags == REL_COND || rd->flags == REL_UNLESS || rd->flags == REL_AND || rd->flags == REL_OR) - return pool_dep_fulfilled_in_map_cplx(pool, map, rd); + return pool_satisfieddep_map_cplx(pool, map, rd); if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_SPLITPROVIDES) return 0; } -- 2.47.2