RPM Control from Python

S

shaneal

Hello,

I'm trying to script some sysadmin stuff, that requires rpm
manipulation (querying installed packages, removing packages,
installing packages).

Rather than manually parsing rpm's output, I noticed that someone had
written python-bindings for the rpmlib library (called rpm-python).
This seems much cleaner, but the documentation is sparse, and I
haven't been able to get uninstalling to work.

As root, I run the following:

I get no error messages/exceptions, but lynx is not removed.

I've also tried things along the lines of:
.... instance = mi.instance()
.... ts.addErase(instance)

and
.... ts.addErase(idx)

I've further confirmed that ts.dbMatch(rpm.RPMTAG_NAME, "lynx") does
in fact find the header for the lynx package via something like:.... print hdr['name'], hdr['version']
....
lynx 2.8.5

The only real documentation I've been able to find is
http://people.redhat.com/pnasrat/rpm-python/rpm-python-slides/frames.html

Is there some other module I should be using for rpm manipulation? Or,
if not, does anyone know what I'm doing wrong with this one?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,273
Latest member
DamonShoem

Latest Threads

Top