Yummy new bot plugin

Monday, May 9, 2011

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- atorvastatin 80 mg.i686 Fedora 14 - i386|size 21MB|Date Mon Oct 18 12:00:00 2010
<thisbot> kernel- 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 🙂


  1. Misc says:

    My roomate wrote a website called Sophie ( http://sophie.zarb.org/ ) to indexes all rpms of various distributions and he plugged this to a irc bot :

    21:22:57| misc> :v gimp -d Fedora -r 14 -a i386
    21:22:58| Sophie> misc: 2:2.6.11-6.fc14 // updates (Fc, 14, i386)
    21:22:58| Sophie> misc: 2:2.6.11-1.fc14 // os (Fc, 14, i386), os (Fc, 14, i386)

    Obviously, you can also set per channel default ( so just typing :v gimp would work ). You can get version, various rpms tags, do complex query, etc. I invite you to chat with the bot on freenode ( /query sophie )

    The bot depend on the huge database ( around 200g, IIRC ), but there would be no problem to ask him to join any channel you need, we already have it for mandriva, mageia and unity channel, and would be quite happy to offer the service for another distribution.

    Alternatively, there is a xml-rpc interface to connect to the server, see http://sophie.zarb.org/help . If you prefer to host your own bot ( that I would understand ) you could write a supybot plugin ( if you do, we can either let you commit on the svn directory, as this would be a useful addition IMHO ).

    Anyway, do not hesitate to contact us, by mail, or on irc ( not this week as we are both on the same free software event ), see on #mageia-dev at freenode.

  2. Dave says:

    Cool, nice work….not sure about the 200G worth of download though, surely you only want the metadata?

    Yeah, I’ll likely hangout on #mageia-dev at some point, I’ve got a bunch of stuff to finish up first, before I jump feet first into something else 🙂

  3. that’s an awesome effort really.. seems i’ll switch more frequently to #fedora rather google 🙂

  4. Dave says:

    Excellent, let me know how you get on 🙂

Leave a Reply