You are not logged in.

#1 2020-02-19 12:57:40

poscat
Member
Registered: 2020-02-17
Posts: 10

Questions regarding libalpm

Hi all. I'm writing a Haskell binding to libalpm(https://github.com/poscat0x04/alpm4h) and I'm having trouble understanding what does these transaction functions do.
My understanding of the transaction process is as following:

init -> (modify transaction) -> commit -> release
       | <-  interruptible -> |

But I'm not so sure about when should I call alpm_trans_prepare? And do I still need to release the transaction after I have interrupted it?

Last edited by poscat (2020-02-19 13:01:17)

Offline

#2 2020-02-20 00:12:57

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: Questions regarding libalpm

From the pacman code:

	/* Step 1: create a new transaction... */
...
	/* Step 2: "compute" the transaction based on targets and flags */
	if(alpm_trans_prepare(config->handle, &data) == -1) {
...
	/* Step 3: actually perform the operation */

	if(alpm_trans_commit(config->handle, &data) == -1) {

And I have not checked, but you likely need to release the transaction after interrupting...

Note that whole libalpm is far better documented (in alpm.h) in the current git repo.

Offline

#3 2020-02-20 00:31:51

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: Questions regarding libalpm

Also, the #archlinux-pacman IRC channel is probably your best bet for answers.

Offline

#4 2020-02-20 08:42:24

poscat
Member
Registered: 2020-02-17
Posts: 10

Re: Questions regarding libalpm

Thanks.

Offline

Board footer

Powered by FluxBB