#include <pakfire/packager.h>
#include <pakfire/parser.h>
#include <pakfire/private.h>
-#include <pakfire/request.h>
#include <pakfire/scriptlet.h>
#include <pakfire/snapshot.h>
-#include <pakfire/transaction.h>
#include <pakfire/types.h>
#include <pakfire/util.h>
"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;
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);