From: Michael Tremer Date: Tue, 5 Oct 2021 14:41:22 +0000 (+0000) Subject: Use pakfire_dep2str X-Git-Tag: 0.9.28~898 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1171f6aebd8555a349ecd715b8d912f355d231f;p=pakfire.git Use pakfire_dep2str Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/package.c b/src/libpakfire/package.c index a5e0f07dc..a31a70944 100644 --- a/src/libpakfire/package.c +++ b/src/libpakfire/package.c @@ -764,15 +764,13 @@ static char** pakfire_package_get_relationlist( if (!q.count) goto ERROR; - Pool* pool = pakfire_get_solv_pool(pkg->pakfire); - // Allocate array array = calloc(q.count + 1, sizeof(*array)); if (!array) goto ERROR; for (int i = 0; i < q.count; i++) { - const char* dep = pool_dep2str(pool, q.elements[i]); + const char* dep = pakfire_dep2str(pkg->pakfire, q.elements[i]); array[i] = strdup(dep); } @@ -1149,7 +1147,6 @@ static int pakfire_package_fetch_legacy_filelist(struct pakfire_package* pkg, st struct pakfire_repo* repo = pakfire_package_get_repo(pkg); Solvable* s = get_solvable(pkg); - Pool* p = pakfire_get_solv_pool(pkg->pakfire); Repo* r = pakfire_repo_get_repo(repo); pakfire_repo_unref(repo); @@ -1158,7 +1155,7 @@ static int pakfire_package_fetch_legacy_filelist(struct pakfire_package* pkg, st Id id, *ids; ids = r->idarraydata + s->provides; while((id = *ids++) != 0) { - const char* path = pool_dep2str(p, id); + const char* path = pakfire_dep2str(pkg->pakfire, id); if (found_marker) { struct pakfire_file* file; diff --git a/src/libpakfire/pakfire.c b/src/libpakfire/pakfire.c index e40a8e8ce..43dd11e12 100644 --- a/src/libpakfire/pakfire.c +++ b/src/libpakfire/pakfire.c @@ -388,7 +388,7 @@ static Id pakfire_namespace_callback(Pool* pool, void* data, Id ns, Id id) { struct pakfire* pakfire = (struct pakfire*)data; const char* namespace = pool_id2str(pool, ns); - const char* name = pool_dep2str(pool, id); + const char* name = pakfire_dep2str(pakfire, id); DEBUG(pakfire, "Namespace callback called for %s(%s)\n", namespace, name); diff --git a/src/libpakfire/problem.c b/src/libpakfire/problem.c index 5a9559ba2..cb4f96d01 100644 --- a/src/libpakfire/problem.c +++ b/src/libpakfire/problem.c @@ -81,15 +81,18 @@ static char* pakfire_problem_make_string(struct pakfire_problem* problem) { break; case SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP: - r = asprintf(&s, _("nothing provides requested %s"), pool_dep2str(pool, dep)); + r = asprintf(&s, _("nothing provides requested %s"), + pakfire_dep2str(problem->pakfire, dep)); break; case SOLVER_RULE_JOB_UNKNOWN_PACKAGE: - r = asprintf(&s, _("package %s does not exist"), pool_dep2str(pool, dep)); + r = asprintf(&s, _("package %s does not exist"), + pakfire_dep2str(problem->pakfire, dep)); break; case SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM: - r = asprintf(&s, _("%s is provided by the system"), pool_dep2str(pool, dep)); + r = asprintf(&s, _("%s is provided by the system"), + pakfire_dep2str(problem->pakfire, dep)); break; case SOLVER_RULE_RPM: @@ -111,7 +114,7 @@ static char* pakfire_problem_make_string(struct pakfire_problem* problem) { case SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP: r = asprintf(&s, _("nothing provides %s needed by %s"), - pool_dep2str(pool, dep), pool_solvid2str(pool, source)); + pakfire_dep2str(problem->pakfire, dep), pool_solvid2str(pool, source)); break; case SOLVER_RULE_RPM_SAME_NAME: @@ -121,42 +124,42 @@ static char* pakfire_problem_make_string(struct pakfire_problem* problem) { case SOLVER_RULE_RPM_PACKAGE_CONFLICT: r = asprintf(&s, _("package %s conflicts with %s provided by %s"), - pool_solvid2str(pool, source), pool_dep2str(pool, dep), + pool_solvid2str(pool, source), pakfire_dep2str(problem->pakfire, dep), pool_solvid2str(pool, target)); break; case SOLVER_RULE_RPM_PACKAGE_OBSOLETES: r = asprintf(&s, _("package %s obsoletes %s provided by %s"), - pool_solvid2str(pool, source), pool_dep2str(pool, dep), + pool_solvid2str(pool, source), pakfire_dep2str(problem->pakfire, dep), pool_solvid2str(pool, target)); break; case SOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES: r = asprintf(&s, _("installed package %s obsoletes %s provided by %s"), - pool_solvid2str(pool, source), pool_dep2str(pool, dep), + pool_solvid2str(pool, source), pakfire_dep2str(problem->pakfire, dep), pool_solvid2str(pool, target)); break; case SOLVER_RULE_RPM_IMPLICIT_OBSOLETES: r = asprintf(&s, _("package %s implicitely obsoletes %s provided by %s"), - pool_solvid2str(pool, source), pool_dep2str(pool, dep), + pool_solvid2str(pool, source), pakfire_dep2str(problem->pakfire, dep), pool_solvid2str(pool, target)); break; case SOLVER_RULE_RPM_PACKAGE_REQUIRES: r = asprintf(&s, _("package %s requires %s, but none of the providers can be installed"), - pool_solvid2str(pool, source), pool_dep2str(pool, dep)); + pool_solvid2str(pool, source), pakfire_dep2str(problem->pakfire, dep)); break; case SOLVER_RULE_RPM_SELF_CONFLICT: r = asprintf(&s, _("package %s conflicts with %s provided by itself"), - pool_solvid2str(pool, source), pool_dep2str(pool, dep)); + pool_solvid2str(pool, source), pakfire_dep2str(problem->pakfire, dep)); break; case SOLVER_RULE_YUMOBS: r = asprintf(&s, _("both package %s and %s obsolete %s"), pool_solvid2str(pool, source), pool_solvid2str(pool, target), - pool_dep2str(pool, dep)); + pakfire_dep2str(problem->pakfire, dep)); break; case SOLVER_RULE_BLACK: @@ -166,7 +169,7 @@ static char* pakfire_problem_make_string(struct pakfire_problem* problem) { case SOLVER_RULE_PKG_CONSTRAINS: r = asprintf(&s, _("package %s has constraint %s conflicting with %s"), - pool_solvid2str(pool, source), pool_dep2str(pool, dep), + pool_solvid2str(pool, source), pakfire_dep2str(problem->pakfire, dep), pool_solvid2str(pool, target)); break;