From: Michael Tremer Date: Sat, 11 Jan 2025 16:55:54 +0000 (+0000) Subject: build: Drop the package list and iterate over the repo instead X-Git-Tag: 0.9.30~435 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b439db842751e4c774b16e7a74371e161501e52;p=pakfire.git build: Drop the package list and iterate over the repo instead Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/build.c b/src/pakfire/build.c index 556adfe84..8b8bcbdb2 100644 --- a/src/pakfire/build.c +++ b/src/pakfire/build.c @@ -94,9 +94,6 @@ struct pakfire_build { // The build repository struct pakfire_repo* repo; - // A list of all built packages - struct pakfire_packagelist* packages; - // Buildroot char buildroot[PATH_MAX]; @@ -1298,18 +1295,8 @@ static int pakfire_build_packages(struct pakfire_build* build, goto ERROR; } - // Create a new packagelist - r = pakfire_packagelist_create(&build->packages, build->ctx); - if (r) - goto ERROR; - - // Fetch all packages - r = pakfire_repo_to_packagelist(build->repo, build->packages); - if (r) - goto ERROR; - // Dump them all - r = pakfire_packagelist_walk(build->packages, pakfire_build_package_dump, build, 0); + r = pakfire_repo_walk_packages(build->repo, pakfire_build_package_dump, build, 0); if (r) goto ERROR; @@ -1679,9 +1666,6 @@ ERROR: } static void pakfire_build_free(struct pakfire_build* build) { - if (build->packages) - pakfire_packagelist_unref(build->packages); - if (build->repo) { pakfire_repo_clean(build->repo, PAKFIRE_REPO_CLEAN_FLAGS_DESTROY); pakfire_repo_unref(build->repo); @@ -2266,8 +2250,7 @@ static int pakfire_build_install_test(struct pakfire_build* build) { goto ERROR; // Add all packages - r = pakfire_packagelist_walk(build->packages, - pakfire_build_install_package, transaction, 0); + r = pakfire_repo_walk_packages(build->repo, pakfire_build_install_package, transaction, 0); if (r < 0) goto ERROR; @@ -2365,6 +2348,7 @@ static int pakfire_build_copy_packages(struct pakfire_build* build) { // Fetch local repository local = pakfire_get_repo(build->pakfire, PAKFIRE_REPO_LOCAL); +#if 0 // Copy all packages to the target path if (*build->target) { r = pakfire_packagelist_walk(build->packages, @@ -2383,6 +2367,7 @@ static int pakfire_build_copy_packages(struct pakfire_build* build) { goto ERROR; } } +#endif ERROR: if (local) @@ -2485,7 +2470,7 @@ static int pakfire_build_lint(struct pakfire_build* build) { int r; // Lint all packages - r = pakfire_packagelist_walk(build->packages, + r = pakfire_repo_walk_packages(build->repo, pakfire_build_lint_package, build, PAKFIRE_PACKAGELIST_KEEPGOING); if (r > 0)