[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Plugin Sub-Packaging



Dear mentors,

Sorry if similar queries have brought up here before (couldn't find any).

I have a package in debian repository, and recently I have developed some plugins for it. The rationale for that is I want the main package to be with least dependencies as possible, and plugins would "add" features that rely on other packages.
It all works good but I would like some feedback if there is a better way to implement this, or this is the right path to take.

Along with this, I am struggling to temper with man pages and the bash_completion from the main application. Basically, a plugin would "add" command line features to the main application, therefore it is run by the main application. I was thinking that the man pages could still be in a {package}-{plugin} style, just for the sake of documentation, but the bash_completion, I really need to place all new rules into the main completion file. 

How it works:

$ sudo apt-get install mypackage
$ mypackage [tab]
option1 option2 ... optionN

$ sudo apt-get install mypackage-pluginA
$ mypackage [tab]
option1 ... optionN option-plugin1 ... option-pluginN

The "hack" I am doing to get this working is to basically to alter the main package bash_completion file, which is created with a variable prepared to be tempered with by plugin installations:

...
opts="option1 ... optionN"
plugin_opts=
...

The debian/rules file would contain the appending routine:

...
sed -e 's:plugin_opts=$plugin_opts:plugin_opts=$plugin_opts" option-plugin1 ... option-pluginN":'
 ...

But it looks like a dirty workaround for this... 

Is there a better way to do this?

Thank in advance,

--
Braga, Bruno
www.brunobraga.net
bruno.braga@gmail.com

Reply to: