FS#9694 - Universal transaction
Attached to Project:
Pacman
Opened by Nagy Gabor (combo) - Tuesday, 26 February 2008, 16:10 GMT
Last edited by Allan McRae (Allan) - Tuesday, 29 December 2020, 13:23 GMT
Opened by Nagy Gabor (combo) - Tuesday, 26 February 2008, 16:10 GMT
Last edited by Allan McRae (Allan) - Tuesday, 29 December 2020, 13:23 GMT
|
Details
I mentioned this several times on ML, this task is a
reminder and a place to discuss it.
So briefly, it would be nice if user could do the following in ONE command (== in one transaction): * select some packages to install (-A/U) * select some packages to remove (-R) * select some packages to sync (-S) * apply dependency/conflict resolving and replaces checking on request Note: the current -S can already do all of these (except + automatically + currently manual replaces is quite hackish: '-Rd foo then -U/S bar' is dangerous; '-S/U var then -R foo' doesn't work always (foo and bar doesn't conflict, but fileconflict) and isn't intuitive at all; doing this cleanly in one transaction is nice + we could focus to one transaction instead of three type of them (and the hard-to-follow transaction branch in case of sync) - getopt() limitation |
This task depends upon
But both FR needs transaction refactoring indeed, and we should keep both request in mind (if we want to implement both) to avoid needless work.
(IMHO 1. implementing universal transaction, 2. add rollback to universal transaction order is easier.)
alpm_trans_init(flags, event_cb, conv_cb, progress_cb);
alpm_trans_add_sync_target(some_pkg);
alpm_trans_add_remove_target(another_pkg);
alpm_trans_commit();
I'm not sure in which order these should be applied though, either as defined (defining a new struct with meta info about the operation and adding to a list), or doing removal first, then syncs.