]> git.ipfire.org Git - pakfire.git/commitdiff
package: Drop helper function to access Pool*
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 27 Apr 2021 11:24:30 +0000 (11:24 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 27 Apr 2021 11:24:30 +0000 (11:24 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/package.c

index 62fe73afbdb5a7e7ccb24d4cee01104ac7a5f51a..1c7bfcee43788e2b755e0588ea4a3fb96ab8a67d 100644 (file)
@@ -53,10 +53,6 @@ struct _PakfirePackage {
        PakfireRepo repo;
 };
 
-static Pool* pakfire_package_get_solv_pool(PakfirePackage pkg) {
-       return pakfire_get_solv_pool(pkg->pakfire);
-}
-
 static void pakfire_package_add_self_provides(Pakfire pakfire, PakfirePackage pkg, const char* name, const char* evr) {
        PakfireRelation relation = pakfire_relation_create(pakfire, name, PAKFIRE_EQ, evr);
        pakfire_package_add_provides(pkg, relation);
@@ -133,7 +129,7 @@ PAKFIRE_EXPORT Pakfire pakfire_package_get_pakfire(PakfirePackage pkg) {
 }
 
 static Solvable* get_solvable(PakfirePackage pkg) {
-       Pool* pool = pakfire_package_get_solv_pool(pkg);
+       Pool* pool = pakfire_get_solv_pool(pkg->pakfire);
 
        return pool_id2solvable(pool, pkg->id);
 }
@@ -145,7 +141,7 @@ static Repo* pakfire_package_solv_repo(PakfirePackage pkg) {
 }
 
 static Id pakfire_package_get_handle(PakfirePackage pkg) {
-       Pool* pool = pakfire_package_get_solv_pool(pkg);
+       Pool* pool = pakfire_get_solv_pool(pkg->pakfire);
        Solvable* s = get_solvable(pkg);
 
        return s - pool->solvables;
@@ -156,7 +152,7 @@ PAKFIRE_EXPORT int pakfire_package_identical(PakfirePackage pkg1, PakfirePackage
 }
 
 PAKFIRE_EXPORT int pakfire_package_cmp(PakfirePackage pkg1, PakfirePackage pkg2) {
-       Pool* pool = pakfire_package_get_solv_pool(pkg1);
+       Pool* pool = pakfire_get_solv_pool(pkg1->pakfire);
 
        Solvable* s1 = get_solvable(pkg1);
        Solvable* s2 = get_solvable(pkg2);
@@ -196,7 +192,7 @@ PAKFIRE_EXPORT int pakfire_package_cmp(PakfirePackage pkg1, PakfirePackage pkg2)
 }
 
 PAKFIRE_EXPORT int pakfire_package_evr_cmp(PakfirePackage pkg1, PakfirePackage pkg2) {
-       Pool* pool = pakfire_package_get_solv_pool(pkg1);
+       Pool* pool = pakfire_get_solv_pool(pkg1->pakfire);
 
        Solvable* s1 = get_solvable(pkg1);
        Solvable* s2 = get_solvable(pkg2);
@@ -209,7 +205,7 @@ PAKFIRE_EXPORT Id pakfire_package_id(PakfirePackage pkg) {
 }
 
 PAKFIRE_EXPORT char* pakfire_package_get_nevra(PakfirePackage pkg) {
-       Pool* pool = pakfire_package_get_solv_pool(pkg);
+       Pool* pool = pakfire_get_solv_pool(pkg->pakfire);
        Solvable* s = get_solvable(pkg);
 
        const char* nevra = pool_solvable2str(pool, s);
@@ -218,28 +214,28 @@ PAKFIRE_EXPORT char* pakfire_package_get_nevra(PakfirePackage pkg) {
 }
 
 PAKFIRE_EXPORT const char* pakfire_package_get_name(PakfirePackage pkg) {
-       Pool* pool = pakfire_package_get_solv_pool(pkg);
+       Pool* pool = pakfire_get_solv_pool(pkg->pakfire);
        Solvable* s = get_solvable(pkg);
 
        return pool_id2str(pool, s->name);
 }
 
 PAKFIRE_EXPORT void pakfire_package_set_name(PakfirePackage pkg, const char* name) {
-       Pool* pool = pakfire_package_get_solv_pool(pkg);
+       Pool* pool = pakfire_get_solv_pool(pkg->pakfire);
        Solvable* s = get_solvable(pkg);
 
        s->name = pool_str2id(pool, name, 1);
 }
 
 PAKFIRE_EXPORT const char* pakfire_package_get_evr(PakfirePackage pkg) {
-       Pool* pool = pakfire_package_get_solv_pool(pkg);
+       Pool* pool = pakfire_get_solv_pool(pkg->pakfire);
        Solvable* s = get_solvable(pkg);
 
        return pool_id2str(pool, s->evr);
 }
 
 PAKFIRE_EXPORT void pakfire_package_set_evr(PakfirePackage pkg, const char* evr) {
-       Pool* pool = pakfire_package_get_solv_pool(pkg);
+       Pool* pool = pakfire_get_solv_pool(pkg->pakfire);
        Solvable* s = get_solvable(pkg);
 
        s->evr = pool_str2id(pool, evr, 1);
@@ -294,7 +290,7 @@ static void split_evr(Pool* pool, const char* evr_c, char** epoch, char** versio
 }
 
 PAKFIRE_EXPORT unsigned long pakfire_package_get_epoch(PakfirePackage pkg) {
-       Pool* pool = pakfire_package_get_solv_pool(pkg);
+       Pool* pool = pakfire_get_solv_pool(pkg->pakfire);
        char *e, *v, *r, *endptr;
 
     unsigned long epoch = 0;
@@ -310,7 +306,7 @@ PAKFIRE_EXPORT unsigned long pakfire_package_get_epoch(PakfirePackage pkg) {
 }
 
 PAKFIRE_EXPORT const char* pakfire_package_get_version(PakfirePackage pkg) {
-       Pool* pool = pakfire_package_get_solv_pool(pkg);
+       Pool* pool = pakfire_get_solv_pool(pkg->pakfire);
        char *e, *v, *r;
 
        split_evr(pool, pakfire_package_get_evr(pkg), &e, &v, &r);
@@ -318,7 +314,7 @@ PAKFIRE_EXPORT const char* pakfire_package_get_version(PakfirePackage pkg) {
 }
 
 PAKFIRE_EXPORT const char* pakfire_package_get_release(PakfirePackage pkg) {
-       Pool* pool = pakfire_package_get_solv_pool(pkg);
+       Pool* pool = pakfire_get_solv_pool(pkg->pakfire);
        char *e, *v, *r;
 
        split_evr(pool, pakfire_package_get_evr(pkg), &e, &v, &r);
@@ -326,14 +322,14 @@ PAKFIRE_EXPORT const char* pakfire_package_get_release(PakfirePackage pkg) {
 }
 
 PAKFIRE_EXPORT const char* pakfire_package_get_arch(PakfirePackage pkg) {
-       Pool* pool = pakfire_package_get_solv_pool(pkg);
+       Pool* pool = pakfire_get_solv_pool(pkg->pakfire);
        Solvable* s = get_solvable(pkg);
 
        return pool_id2str(pool, s->arch);
 }
 
 PAKFIRE_EXPORT void pakfire_package_set_arch(PakfirePackage pkg, const char* arch) {
-       Pool* pool = pakfire_package_get_solv_pool(pkg);
+       Pool* pool = pakfire_get_solv_pool(pkg->pakfire);
        Solvable* s = get_solvable(pkg);
 
        s->arch = pool_str2id(pool, arch, 1);
@@ -385,7 +381,7 @@ static char** pakfire_package_get_string_array(PakfirePackage pkg, Id key) {
        Queue ids;
        queue_init(&ids);
 
-       Pool* pool = pakfire_package_get_solv_pool(pkg);
+       Pool* pool = pakfire_get_solv_pool(pkg->pakfire);
        Solvable* s = get_solvable(pkg);
        solvable_lookup_idarray(s, key, &ids);
 
@@ -604,7 +600,7 @@ PAKFIRE_EXPORT void pakfire_package_set_filename(PakfirePackage pkg, const char*
 }
 
 PAKFIRE_EXPORT int pakfire_package_is_installed(PakfirePackage pkg) {
-       Pool* pool = pakfire_package_get_solv_pool(pkg);
+       Pool* pool = pakfire_get_solv_pool(pkg->pakfire);
        Solvable* s = get_solvable(pkg);
 
        return pool->installed == s->repo;
@@ -1028,7 +1024,7 @@ static int pakfire_package_fetch_legacy_filelist(PakfirePackage pkg, PakfireFile
 
        PakfireRepo repo = pakfire_package_get_repo(pkg);
        Solvable* s = get_solvable(pkg);
-       Pool* p = pakfire_package_get_solv_pool(pkg);
+       Pool* p = pakfire_get_solv_pool(pkg->pakfire);
        Repo* r = pakfire_repo_get_repo(repo);
        pakfire_repo_unref(repo);
 
@@ -1069,7 +1065,7 @@ static int pakfire_package_fetch_filelist(PakfirePackage pkg, PakfireFilelist fi
 
        pakfire_package_internalize_repo(pkg);
 
-       Pool* pool = pakfire_package_get_solv_pool(pkg);
+       Pool* pool = pakfire_get_solv_pool(pkg->pakfire);
        Repo* repo = pakfire_package_solv_repo(pkg);
        Id handle = pakfire_package_get_handle(pkg);