From: Łukasz Stelmach Date: Tue, 12 Nov 2013 09:29:58 +0000 (+0100) Subject: Configure paths with MIC_LIBRARY_PATH and MIC_PLUGIN_DIR X-Git-Tag: 0.23~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ad96fd3492eef57509e2b66638a0e7080b63e5de;p=tools%2Fmic.git Configure paths with MIC_LIBRARY_PATH and MIC_PLUGIN_DIR Enable passing location of mic files via environment variables: MIC_LIBRARY_PATH and MIC_PLUGIN_DIR to override values that are either hardcoded (MIC_LIBRARY_PATH) or set in the global configuration file. Change-Id: I601b06ba0e7953ba3882511af811a6f8cefa3585 Signed-off-by: Łukasz Stelmach --- diff --git a/mic/conf.py b/mic/conf.py index 5c14c5d..20dc75a 100644 --- a/mic/conf.py +++ b/mic/conf.py @@ -43,8 +43,6 @@ class ConfigMgr(object): "tmpdir": '/var/tmp/mic', "cachedir": '/var/tmp/mic/cache', "outdir": './mic-output', - - "plugin_dir": "/usr/lib/mic/plugins", "arch": None, # None means auto-detect "pkgmgr": "auto", "name": "output", @@ -144,6 +142,9 @@ class ConfigMgr(object): if section in self.DEFAULTS: getattr(self, section).update(dict(parser.items(section))) + if os.getenv("MIC_PLUGIN_DIR"): + self.common["plugin_dir"] = os.environ["MIC_PLUGIN_DIR"] + # append common section items to other sections for section in self.DEFAULTS.keys(): if section != "common": diff --git a/mic/rt_util.py b/mic/rt_util.py index c5a0c5c..41b607f 100644 --- a/mic/rt_util.py +++ b/mic/rt_util.py @@ -185,8 +185,7 @@ def get_mic_modpath(): return os.path.dirname(path) def get_mic_libpath(): - # TBD: so far mic lib path is hard coded - return "/usr/lib/mic" + return os.getenv("MIC_LIBRARY_PATH", "/usr/lib/mic") # the hard code path is prepared for bootstrap def sync_mic(bootstrap, binpth = '/usr/bin/mic',