]> git.ipfire.org Git - pakfire.git/blobdiff - src/libpakfire/package.c
dependencies: Drop the legacy logger
[pakfire.git] / src / libpakfire / package.c
index e41f0a1a6c0a3d4fb41485d70bf65fc160288bff..173bb476aa36a58da4edd36e6416f8fd8cdaaee4 100644 (file)
@@ -58,6 +58,8 @@ struct pakfire_package {
        struct pakfire* pakfire;
        int nrefs;
 
+       Pool* pool;
+
        // Reference to this package in the SOLV pool
        Id id;
        struct pakfire_repo* repo;
@@ -171,6 +173,9 @@ int pakfire_package_create_from_solvable(struct pakfire_package** package,
        pkg->pakfire = pakfire_ref(pakfire);
        pkg->nrefs = 1;
 
+       // Store a reference to the pool
+       pkg->pool = pakfire_get_solv_pool(pkg->pakfire);
+
        // Store the ID
        pkg->id = id;
 
@@ -1336,7 +1341,7 @@ PAKFIRE_EXPORT char** pakfire_package_get_deps(struct pakfire_package* pkg,
                goto ERROR;
 
        for (int i = 0; i < q.count; i++) {
-               dep = pakfire_dep2str(pkg->pakfire, q.elements[i]);
+               dep = pakfire_dep2str(pkg->ctx, pkg->pool, q.elements[i]);
                if (!dep)
                        goto ERROR;
 
@@ -1363,7 +1368,7 @@ SUCCESS:
 int pakfire_package_add_dep(struct pakfire_package* pkg,
                const enum pakfire_package_key key, const char* dep) {
        // Parse the dependency
-       Id id = pakfire_str2dep(pkg->pakfire, dep);
+       Id id = pakfire_str2dep(pkg->ctx, pkg->pool, dep);
 
        // Silently ignore any invalid dependencies
        if (!id)
@@ -1413,7 +1418,7 @@ static int pakfire_package_has_rich_deps_in_deparray(
                goto ERROR;
 
        for (int i = 0; i < q.count; i++) {
-               const char* dep = pakfire_dep2str(pkg->pakfire, q.elements[i]);
+               const char* dep = pakfire_dep2str(pkg->ctx, pkg->pool, q.elements[i]);
 
                // Is this a rich dependency?
                if (dep && *dep == '(') {
@@ -1465,7 +1470,7 @@ int pakfire_package_matches_dep(struct pakfire_package* pkg,
                return r;
 
        // Get the dependency
-       Id depid = pakfire_str2dep(pkg->pakfire, dep);
+       Id depid = pakfire_str2dep(pkg->ctx, pkg->pool, dep);
        if (!depid)
                return -1;