<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Sample plugin has no difference from
other plugins, it is wrong to specially design a command for that
sample plugin.<br>
A plugin should have a way to disable itself, I prefer the
original way to disable a plugin like below.<br>
<br>
In plugin descriptor xml file, comment out all tabs, if no tabs is
defined, then the plugin will not be loaded.<br>
By this way, no special command is needed, no additional overhead
in coding is needed.<br>
<br>
<img src="cid:part1.03030308.04060808@linux.vnet.ibm.com" alt=""><br>
<br>
On 5/19/2014 5:31 PM, Yu Xin Huo wrote:<br>
</div>
<blockquote cite="mid:5379CF7C.7040906@linux.vnet.ibm.com"
type="cite">On 5/17/2014 3:30 AM, <a class="moz-txt-link-abbreviated" href="mailto:shaohef@linux.vnet.ibm.com">shaohef@linux.vnet.ibm.com</a>
wrote:
<br>
<blockquote type="cite">From: ShaoHe Feng
<a class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
<br>
<br>
sample plugin is used to test as a plugin demo.
<br>
<br>
we disable it by default.
<br>
<br>
use this command to enable sample plugin
<br>
$ ./autogen.sh --enable-plugins
<br>
</blockquote>
As this command is specially used to enable the sample plugin, so
the param of "enable-plugins" is quite confusing, looks like
enabling all the plugins.
<br>
If it is only to enable that sample plugin, I do not think it is
worth to add such a command specially for that.
<br>
<blockquote type="cite">
<br>
Signed-off-by: ShaoHe Feng <a class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
<br>
---
<br>
configure.ac | 10 ++++++++++
<br>
plugins/sample/Makefile.am | 18
+++++++++++++++++-
<br>
plugins/sample/{sample.conf => sample.conf.in} | 2 +-
<br>
3 files changed, 28 insertions(+), 2 deletions(-)
<br>
rename plugins/sample/{sample.conf => sample.conf.in} (90%)
<br>
<br>
diff --git a/configure.ac b/configure.ac
<br>
index cc971e8..ab1b302 100644
<br>
--- a/configure.ac
<br>
+++ b/configure.ac
<br>
@@ -48,6 +48,16 @@ if test "x$PYFLAKES" = "x"; then
<br>
AC_MSG_WARN([pyflakes not found])
<br>
fi
<br>
<br>
+AC_ARG_ENABLE(
<br>
+ [plugins],
<br>
+ [AS_HELP_STRING(
<br>
+ [--enable-plugins],
<br>
+ [build plugins packages @<:@default=no@:>@]
<br>
+ )],
<br>
+ ,
<br>
+ [enable_plugins="no"]
<br>
+)
<br>
+AM_CONDITIONAL([PLUGINS], [test "${enable_plugins}" = "yes"])
<br>
<br>
AC_CONFIG_FILES([
<br>
po/Makefile.in
<br>
diff --git a/plugins/sample/Makefile.am
b/plugins/sample/Makefile.am
<br>
index e03a4c0..b0beb32 100644
<br>
--- a/plugins/sample/Makefile.am
<br>
+++ b/plugins/sample/Makefile.am
<br>
@@ -19,4 +19,20 @@
<br>
<br>
SUBDIRS = ui
<br>
<br>
-EXTRA_DIST = API.json sample.conf $(wildcard *.py)
<br>
+EXTRA_DIST = API.json sample.conf.in $(wildcard *.py)
<br>
+
<br>
+if PLUGINS
<br>
+ENABLE_PLUGINS = True
<br>
+else
<br>
+ENABLE_PLUGINS = False
<br>
+endif
<br>
+
<br>
+do_substitution = \
<br>
+ sed -e 's,[@]ENABLE_PLUGINS[@],$(ENABLE_PLUGINS),g'
<br>
+
<br>
+sample.conf: sample.conf.in Makefile
<br>
+ echo $(ENABLE_PLUGINS)
<br>
+ $(do_substitution) < $< > $@
<br>
+
<br>
+BUILT_SOURCES = sample.conf
<br>
+CLEANFILES = sample.conf
<br>
diff --git a/plugins/sample/sample.conf
b/plugins/sample/sample.conf.in
<br>
similarity index 90%
<br>
rename from plugins/sample/sample.conf
<br>
rename to plugins/sample/sample.conf.in
<br>
index 78a9f4e..12a3eef 100644
<br>
--- a/plugins/sample/sample.conf
<br>
+++ b/plugins/sample/sample.conf.in
<br>
@@ -1,5 +1,5 @@
<br>
[kimchi]
<br>
-enable = True
<br>
+enable = @ENABLE_PLUGINS@
<br>
plugin_class = "Drawings"
<br>
uri = "/plugins/sample"
<br>
<br>
</blockquote>
<br>
<br>
_______________________________________________
<br>
Kimchi-devel mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.ovirt.org/mailman/listinfo/kimchi-devel">http://lists.ovirt.org/mailman/listinfo/kimchi-devel</a>
<br>
<br>
</blockquote>
<br>
</body>
</html>