<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">On 05/20/2014 02:53 PM, Yu Xin Huo
wrote:<br>
</div>
<blockquote cite="mid:537AFBCF.3090205@linux.vnet.ibm.com"
type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<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>
</div>
</blockquote>
Does that mean the user needs to find this file and uncomment these
codes when he want to try the plugin.<br>
<br>
Usually, a user wants to add a new plugin, he can reference the
sample plugin codes.<br>
He can try it first to how it works and then read the code to how he
can make himself plugin.<br>
<br>
we can change "--enbale-plugins" to "--enable-sample".<br>
our switch command("--enable-sample") is also an example, ti tells
user how he build a plugin with kimchi <br>
together if he just add one plugin.<br>
<br>
Also he can add "with" command for his plugins if he wants to add
more than one plugin.<br>
such as:<br>
--with-plugins=plugin1,plugin2,plugin3<br>
The "with" command is similar to switch command, a plugin
developer can read the autotool document to<br>
learn more about it.<br>
<br>
<br>
<blockquote cite="mid:537AFBCF.3090205@linux.vnet.ibm.com"
type="cite">
<div class="moz-cite-prefix"> <br>
<img src="cid:part1.05030209.06010003@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 moz-do-not-send="true"
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
moz-do-not-send="true" 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 moz-do-not-send="true"
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 moz-do-not-send="true" class="moz-txt-link-abbreviated"
href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
<br>
<a moz-do-not-send="true" 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>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Kimchi-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
<a class="moz-txt-link-freetext" href="http://lists.ovirt.org/mailman/listinfo/kimchi-devel">http://lists.ovirt.org/mailman/listinfo/kimchi-devel</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Thanks and best regards!
Sheldon Feng(冯少合)<a class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
IBM Linux Technology Center</pre>
</body>
</html>