]> git.ipfire.org Git - pakfire.git/commitdiff
package: Remove function that returns a handle which is the ID
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 27 Apr 2021 11:34:33 +0000 (11:34 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 27 Apr 2021 11:34:33 +0000 (11:34 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/package.c

index aabf7ef04c10127a220e72acf38e57df6173692b..fb7a979d35f34c6c298104dfb2020f05b1fe33bc 100644 (file)
@@ -140,13 +140,6 @@ static Repo* pakfire_package_solv_repo(PakfirePackage pkg) {
        return s->repo;
 }
 
-static Id pakfire_package_get_handle(PakfirePackage pkg) {
-       Pool* pool = pakfire_get_solv_pool(pkg->pakfire);
-       Solvable* s = get_solvable(pkg);
-
-       return s - pool->solvables;
-}
-
 PAKFIRE_EXPORT int pakfire_package_identical(PakfirePackage pkg1, PakfirePackage pkg2) {
        return pkg1->id == pkg2->id;
 }
@@ -1067,10 +1060,9 @@ static int pakfire_package_fetch_filelist(PakfirePackage pkg, PakfireFilelist fi
 
        Pool* pool = pakfire_get_solv_pool(pkg->pakfire);
        Repo* repo = pakfire_package_solv_repo(pkg);
-       Id handle = pakfire_package_get_handle(pkg);
 
        Dataiterator di;
-       dataiterator_init(&di, pool, repo, handle,
+       dataiterator_init(&di, pool, repo, pkg->id,
                SOLVABLE_FILELIST, NULL, SEARCH_FILES | SEARCH_COMPLETE_FILELIST);
 
        while (dataiterator_step(&di)) {
@@ -1124,8 +1116,6 @@ static int pakfire_package_append_file(PakfirePackage pkg, const char* path) {
        Repodata* repodata = pakfire_repo_get_repodata(repo);
        pakfire_repo_unref(repo);
 
-       Id handle = pakfire_package_get_handle(pkg);
-
        char* basename = pakfire_basename(path);
        char* dirname  = pakfire_dirname(path);
 
@@ -1135,7 +1125,7 @@ static int pakfire_package_append_file(PakfirePackage pkg, const char* path) {
                did = repodata_str2dir(repodata, "/", 1);
 
        // Add data to list
-       repodata_add_dirstr(repodata, handle,
+       repodata_add_dirstr(repodata, pkg->id,
                SOLVABLE_FILELIST, did, basename);
 
        free(basename);