theedge: new plugin system

Auke Kok sofar at lunar-linux.org
Wed Mar 23 20:44:08 UTC 2005


Hi everyone,

Here's a short note on a patch I merged with theedge today. It basically 
comprises a plugin system that will be able to extend parts of the lunar 
code without the need to edit the original core tools. The patch has 
been merged with theedge only at the moment.

The code currently supports plugins for downloading source code over new 
protocols. I have migrated the cvs:// and svn:// handling code to use 
this new plugin system and thus there are no changes to the user or 
module developer.

However, people who wish to see new methods supported can now write a 
frontend plugin and put the plugin in /var/lib/lunar/plugins. The lunar 
code will pickup your pluing automatically and with the plugin_register 
call you can add hooks to your plugin to be called at specific moments. 
Currently there are only two hooks implemented but I intend to look for 
more code that can be moved to plugins to simplify the code base.

Another aspect is that with this plugin system, it becomes possible to 
provide custom modules that install these plugins themselves, thus 
extending your codebase as needed. In the future, the subversion module 
(and also the cvs module) will install the plugin code that allows you 
to download lunar sources using these protocols directly.

In the future, you can think of interesting protocols like torrent://, 
perhaps rsync:// or more exotic protocols being implemented. The plugin 
download code also allows fallback to other URLs automatically, just as 
the old code.

I hope people enjoy the new code and come up with more plugins and other 
parts of the core code that can be modularized.

PS: as usual, theedge is the only place these development patches get 
merged into. the 'lunar' module is safe from them.

sofar



More information about the Lunar-dev mailing list