[Kimchi-devel] [wok] Add specific state_dir values to plugins

Lucio Correia luciojhc at linux.vnet.ibm.com
Wed Aug 26 17:08:41 UTC 2015


The debugreports and screenshots generated were being saved to
/var/lib/wok instead of /var/lib/kimchi, due to absence of
plugin-specific state_dir config. This patch adds it.

Now, when the plugin is installed, those files are saved to
/var/lib/<plugin_name>, and, when running from source, to
plugins/<plugin_name>/data.

That also affects Ginger, which backups are now saved to
/var/lib/ginger/ginger_backups.

Signed-off-by: Lucio Correia <luciojhc at linux.vnet.ibm.com>
---
 src/wok/config.py.in |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/wok/config.py.in b/src/wok/config.py.in
index 5ffa936..08da028 100644
--- a/src/wok/config.py.in
+++ b/src/wok/config.py.in
@@ -88,10 +88,13 @@ class PluginPaths(Paths):
         self.plugin_dir = os.path.join('plugins', name)
 
         if self.installed:
+            self.state_dir = '@localstatedir@/lib/%s' % name
             self.conf_dir = '@sysconfdir@/wok/plugins.d'
             self.src_dir = os.path.join('@wokdir@', self.plugin_dir)
             self.mo_dir = '@prefix@/share/locale'
         else:
+            self.state_dir = self.add_prefix(os.path.join(self.plugin_dir,
+                                             'data'))
             self.conf_dir = self.add_prefix(self.plugin_dir)
             self.src_dir = self.add_prefix(self.plugin_dir)
             self.mo_dir = self.add_prefix(os.path.join(self.plugin_dir, 'mo'))
-- 
1.7.1




More information about the Kimchi-devel mailing list