Over the past few days I’ve been working on a yum plugin that will pick-up local yum repository mirrors using avahi. It wouldn’t have taken that long to sort out if I hadn’t failed to read the bit of the dbus tutorial I was reading that said I’d need “import dbus.glib” to make callbacks work.
I spent many hours trying to work out what was going on. Steve found the problem with me not importing dbus.glib. Thanks Mr Steve.
I’ve put the code up here. It’s a git repository. Grab it using:
git clone http://www.ecs.soton.ac.uk/~rds204/yum-avahi/.git
There are two python files: repos_announce.py and repos_listen.py
repos_announce.py: This is to be run on the server. It uses avahi to tell the rest of the network that a yum repository is available locally. It points to the http server that it runs which servers the “conf” file, which contains the configuration for the various yum repositories.
repos_listen.py: This is the yum plugin. Stick it in the yum plugins directory (defaults to /usr/lib/yum-plugins). The yum plugin also requires a configuration file called “repos_listen.conf” which sits in the yum plugin config directory (/etc/yum/pluginconf.d), and this needs to contain:
[main]
enabled = 1
Currently it will only attempt to grab repositories that you already have configured.
I reckon it’s a relatively safe thing to have enabled even in potentially unfriendly networks, as long as you have gpgkey checking enabled.
Comments welcome.
2 responses to “avahi… mmmm… yum.”
Site by Rob Gilton. © 2008 - 2019
Yum! Of course, if you were using apt…. you’d still have the problem. Umm, not sure Ubuntu fanboyism has much of an outlet here. Must Try Harder.
Looks cool… want to send it to yum-devel-list for some discussion and potential inclusion in yum-utils? :)