From: Michael Tremer Date: Mon, 14 Jun 2021 16:51:47 +0000 (+0000) Subject: build: Use pakfire_install to install build dependencies X-Git-Tag: 0.9.28~1245 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=976d4999eaffe8aeb9447004cde4787a6b79e399;p=pakfire.git build: Use pakfire_install to install build dependencies Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/build.c b/src/libpakfire/build.c index 464e8d410..c19a4e840 100644 --- a/src/libpakfire/build.c +++ b/src/libpakfire/build.c @@ -31,10 +31,8 @@ #include #include #include -#include #include #include -#include #include #include @@ -59,8 +57,6 @@ static const char* stages[] = { "exit 0\n" static int pakfire_build_install_packages(Pakfire pakfire, int* snapshot_needs_update) { - struct pakfire_request* request = NULL; - struct pakfire_transaction* transaction = NULL; char** packages = NULL; int r = 1; @@ -78,49 +74,21 @@ static int pakfire_build_install_packages(Pakfire pakfire, int* snapshot_needs_u if (!packages) goto ERROR; - // Create a new request - r = pakfire_request_create(&request, pakfire, 0); - if (r) + // Install everything + r = pakfire_install(pakfire, (const char**)packages, 0); + if (r) { + ERROR(pakfire, "Could not install build dependencies\n"); goto ERROR; - - // Install all packages - for (char** package = packages; *package; package++) { - r = pakfire_request_install(request, *package, 0); - if (r) { - ERROR(pakfire, "Cannot install '%s': %m\n", *package); - goto ERROR; - } } - // XXX update everything - - // Solve the request - r = pakfire_request_solve(request, 0); - if (r) - goto ERROR; - - // Fetch the transaction - transaction = pakfire_request_get_transaction(request); - if (!transaction) - goto ERROR; + // XXX Update everything - // Mark the snapshot for update - if (pakfire_transaction_count(transaction)) - *snapshot_needs_update = 1; - - // Run the transaction - r = pakfire_transaction_run(transaction); - if (r) - goto ERROR; + // XXX How do we know that the snapshot needs to be updated? // Success r = 0; ERROR: - if (transaction) - pakfire_transaction_unref(transaction); - if (request) - pakfire_request_unref(request); if (packages) { for (char** package = packages; *package; package++) free(*package);