]> git.ipfire.org Git - pakfire.git/commitdiff
Use pakfire_dep2str
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 5 Oct 2021 14:41:22 +0000 (14:41 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 5 Oct 2021 14:45:03 +0000 (14:45 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/package.c
src/libpakfire/pakfire.c
src/libpakfire/problem.c

index a5e0f07dc99b8db4dc86c8f9ac6540d29551945b..a31a70944b662ecdce1efb0740e0e60542855614 100644 (file)
@@ -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;
index e40a8e8cec6d685bbe42c4a4b6acceac7fdcc790..43dd11e122bf30e6444cd82b3cfcbbe56b5f3b6b 100644 (file)
@@ -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);
 
index 5a9559ba20395d4fa9327738fd83922100eb6edf..cb4f96d016cb4c0bb822656665cad4626d9d3430 100644 (file)
@@ -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;