[PATCH 0/3] Restrict the list of plugins to use



From: "Juan A. Suarez Romero" <jasuarez igalia com>

While examinating the patch that Lionel provided (thanks very much for it,
indeed), I realized about a small problem we had with the XML files: while we
can use a envvar or even "--grl-plugin-path" to define different places to get
the plugins, this can't be done for the XML files: they are always loaded from
the same place[1]. And adding a new envvar and parameter to do the same as the
plugins libraries doesn't seem to be a good idea (too much envvars).

So looking how libpeas was addressing this problem, basically they distribute
their XML files (actually, a different file) in the same place as the library
itself. This seems a good idea, and makes life easier to know where to put the
XML files: in the same place as the .so

So I refactor the code to install the XML files (and load them) from the same
place than the libraries. GRL_PLUGIN-PATH/--grl-plugin-path will act on both
kind of files. I took this refactoring also to do some improvements in the
code.

And over that refactoring I re-wrote the patch provided by Lionel. Now, there
is a envvar (GRL_PLUGIN_USE) and a parameter (--grl-plugin-use) that can be
used to restrict the plugins to use in the application; therefore, application
will only see the plugins in the list, no matter if there are other plugins
already installed. The only way of loading a plugin not in the list is using
grl_plugin_registry_load() function, that gets the .so itself and load it. But
the other functions (load_directory(), load_all(), load_by_id()) will be
restricted to the list.

	J.A.

[1] I know there are people that don't like very much these XML files. I'll
bring this issue in a different thread. So please, do not arguee in this thread
about those XML. The intention is to fix a small problem while not breaking our
current API.

Juan A. Suarez Romero (3):
  core: install plugins XML file in the same place as the plugin itself
  core: Refactor the way of loading plugins
  core: Allow restricting the list of plugins to use

 configure.ac              |    8 -
 src/Makefile.am           |    2 -
 src/grilo.c               |   26 ++-
 src/grl-plugin-registry.c |  422 +++++++++++++++++++++++++++------------------
 src/grl-plugin-registry.h |    6 +-
 5 files changed, 279 insertions(+), 185 deletions(-)

-- 
1.7.5.4



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