From: Michael Tremer Date: Sat, 11 Jan 2025 17:10:45 +0000 (+0000) Subject: package: Simplify adding all build packages X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=950cedb7d6971d4a7b159dc8ad05958a34f67e7e;p=people%2Fric9%2Fpakfire.git package: Simplify adding all build packages Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/package.c b/src/pakfire/package.c index e43748735..89dc60f7a 100644 --- a/src/pakfire/package.c +++ b/src/pakfire/package.c @@ -2372,7 +2372,6 @@ static int __pakfire_package_add_build_packages(struct pakfire_ctx* ctx, static int pakfire_package_add_build_packages(struct pakfire_package* pkg, struct json_object* md) { struct pakfire_repo* repo = NULL; - struct pakfire_packagelist* packages = NULL; struct json_object* object = NULL; int r; @@ -2392,20 +2391,8 @@ static int pakfire_package_add_build_packages(struct pakfire_package* pkg, goto ERROR; } - // Create a new list - r = pakfire_packagelist_create(&packages, pkg->ctx); - if (r) - goto ERROR; - - // Fetch all installed packages - r = pakfire_repo_to_packagelist(repo, packages); - if (r) { - ERROR(pkg->ctx, "Could not fetch packages from installed repository: %m\n"); - goto ERROR; - } - // Add all packages to the array - r = pakfire_packagelist_walk(packages, __pakfire_package_add_build_packages, object, 0); + r = pakfire_repo_walk_packages(repo, __pakfire_package_add_build_packages, object, 0); if (r) goto ERROR; @@ -2415,8 +2402,6 @@ static int pakfire_package_add_build_packages(struct pakfire_package* pkg, goto ERROR; ERROR: - if (packages) - pakfire_packagelist_unref(packages); if (repo) pakfire_repo_unref(repo); if (object)