// The solver
Solver* solver;
- enum pakfire_transaction_solver_status {
- SOLVER_STATUS_UNKNOWN,
- } solver_status;
// The jobs to solve
Queue jobs;
PAKFIRE_EXPORT int pakfire_transaction_run(
struct pakfire_transaction* transaction, int flags) {
+ char* dump = NULL;
int r;
- // XXX automatically solve
- // XXX automatically download
+ // Automatically solve if not done, yet
+ if (!transaction->transaction) {
+ r = pakfire_transaction_solve(transaction, 0, NULL);
+ if (r)
+ goto ERROR;
+ }
// Skip running an empty transaction
if (!transaction->num) {
}
// Show what would be done
- char* dump = pakfire_transaction_dump(transaction, 80);
+ dump = pakfire_transaction_dump(transaction, 80);
// Check if we should continue
r = pakfire_confirm(transaction->pakfire, dump, _("Is this okay?"));
ERROR:
// Cleanup
- free(dump);
+ if (dump)
+ free(dump);
return r;
}