You are not logged in.

#1 2011-08-19 16:39:59

newdave
Member
Registered: 2011-07-06
Posts: 15

[SOLVED] What does exactly "Transaction" mean in Pacman?

While reading Pacman source code, I constantly stumble upon functions like alpm_add_pkg that apparently do something about the transaction( in case of alpm_add_pkg it adds a package to transaction). What exactly it means to add/remove a package to/from a transaction? There are similar functions like alpm_trans_int (initializes the transaction), alpm_trans_prepare, alpm_trans_commit and so on. What are their usages?

Last edited by newdave (2011-08-20 04:14:57)

Offline

#2 2011-08-19 19:23:16

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED] What does exactly "Transaction" mean in Pacman?

We don't implement true transactions as they exist in databases, but the idea is that we collect as much information as possible about the operation before doing anything destructive. We check packages dependencies, package conflicts, package replacements, file conflicts, checksum verification, gpg signature verification (!!!), diskspace requirements, and possibly get user feedback about one or more of these things before actually "committing" it -- that is, writing to disk. If any of these checks fail, we do nothing at all. It's on the road map to add better transaction support which will allow for things like rollbacks and multiple operations (add foo and bar, remove baz). I won't speculate as to when we'll get around to this.

https://bugs.archlinux.org/task/9694
https://bugs.archlinux.org/task/8585

Offline

#3 2011-08-20 04:14:19

newdave
Member
Registered: 2011-07-06
Posts: 15

Re: [SOLVED] What does exactly "Transaction" mean in Pacman?

falconindy wrote:

We don't implement true transactions as they exist in databases, but the idea is that we collect as much information as possible about the operation before doing anything destructive. We check packages dependencies, package conflicts, package replacements, file conflicts, checksum verification, gpg signature verification (!!!), diskspace requirements, and possibly get user feedback about one or more of these things before actually "committing" it -- that is, writing to disk. If any of these checks fail, we do nothing at all. It's on the road map to add better transaction support which will allow for things like rollbacks and multiple operations (add foo and bar, remove baz). I won't speculate as to when we'll get around to this.

https://bugs.archlinux.org/task/9694
https://bugs.archlinux.org/task/8585

Thanks a lot! The Wikipedia entry was also very helpful. I'm reading trans.c in libalpm now and things have already started to become even more clear smile

Offline

Board footer

Powered by FluxBB