fun with the python shell

November 12, 2004

For reasons I’m not aware of I decided I wanted to test out the structure I’ve put together in yum and test the modularity of it.

so I ran the python interpreter and attempted to setup a usable transaction with as few commands as possible.

The closest I got, with a little bit of method adding:

import yum

my = yum.YumBase()

my.doConfigSetup()

my.doRepoSetup()

my.doSackSetup()

my.doTsSetup()

my.doRpmDBSetup()

my.tsInfo.add((‘yum’, ‘noarch’, ‘0’, ‘2.1.11’, ‘3’), ‘e’)

my.buildTransaction()

at that point everything was depchecked and ready to be executed. The transaction is simple, of course, just marking the yum package to be removed but it’s not a huge amount of work to get there in the simplest possible sense. I can think of a couple of places where straightforward methods for adding packages by less than a complete pkgtup would be useful. This will be more useful when we start dealing with how to work out adding the gui.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: