Over the last few days, my free time has been taken up with writing a new supybot plugin….
Basically, I help out on #fedora a fair bit, and it seems to be that a large proportion of the questions from users are “does fedora ship foo” or “what version of bar does fedora have” or “how to I get /lib/foo.so”, so I figured – it would be nice to have fedbot be able to answer those queries directly – save us all typing “yum provides”.
So I started digging through the source for repoquery, and realized that in the most part, it uses yum – so I started digging through yum 🙂
The main reason for my post is – I’ve now spent a fair amount of time digging through yum’s python bindings and I’ve got to say, its very,very complete (I’ll note, I needed direction from both skvidal and gepetto on #yum – thanks guys! 🙂 ). I guess, what you see with the cli command doesn’t always reflect the power of the application behind it.
Anyway, work on the plugin is progressing nicely, it can already give the version of a package from a given fedora release and arch like so:
<dcr226> rversion 14 x32 kernel
<thisbot> kernel-22.214.171.124-45.fc14.i686 Fedora 14 - i386|size 21MB|Date Mon Oct 18 12:00:00 2010
<thisbot> kernel-126.96.36.199-90.fc14.i686 Fedora 14 - i386 - Updates|size 21MB|Date Fri Apr 22 12:00:00 2011
now, the information above is gained directly from the fedora repos (via the mirrorlist), and it queries the standard fedora&updates repos, although getting it to query updates-testing is trivial.
The second function I’ve been working on is rprovides. This one works in the same way that yum provides does, giving you the package which provides a given command/library/whatever:
<dcr226> rprovides 14 /bin/ls
<thisbot> coreutils-8.5-6.fc14.x86_64 Fedora 14 - x86_64|size 3MB|Date Fri Oct 1 12:00:00 2010
<thisbot> coreutils-8.5-7.fc14.x86_64 Fedora 14 - x86_64 - Updates|size 3MB|Date Wed Nov 3 12:00:00 2010
So far so good; hoping to further increase the capabilities of this plugin to include other yum functions. I’m also hoping to get bodhi information in there also.
Any feedback/feature requests are much appreciated 🙂