yum transaction journal

August 17, 2007

I just got finished checking a useful feature into yum. It’s a transaction journal. I have talked about the idea before but I hadn’t really sat down to do the other infrastructure work to make it happen. This last week I did that and it really wasn’t very difficult. Here’s how it works:

When you setup a transaction yum writes out a complete list of each individual action that is going to occur. So if you say:

yum install foo
then the action is:

install foo-v-r.arch

yum remove bar

then the action is:

erase bar-v-r.arch


yum update baz

then the action is:

install baz-v-r.arch
remove baz-v-r.arch

That’s right – in rpm every update is actually an install of the new pkg and an erase of the files from the old pkg which don’t overlap.
So yum writes these out to a file before the transaction. Then once the transaction starts it writes out each of the items it has completed.
The idea is that if your computer dies, or X dies or the power goes out or yum aborts or rpm freezes or aliens invade – and any of these things kill your transaction – you can just look at what was proposed, look at what is left undone and do the rest. I’m currently working on some code to add to yum to check for undone transaction elements so it can prompt you to finish them.
Anyway – I hope this feature is completely useless to most of you b/c you never have an aborted transaction. But it seems like a nice thing to have just in case


3 Responses to “yum transaction journal”

  1. Sarantis Paskalis Says:

    Have you by any chance finished the code to finish undone transaction elements? I could use/test it 🙂


  2. […] takes the transaction-journaling I talked about back in august and makes it simple to […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: