setup __cdist_base_dir

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-10-07 13:50:37 +02:00
parent ed347ffb8a
commit 1b484e2d87

View file

@ -46,6 +46,7 @@ class Context:
else:
self.base_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
# Input directories
self.cache_dir = os.path.join(self.base_dir, "cache", target_host)
self.conf_dir = os.path.join(self.base_dir, "conf")
@ -86,6 +87,8 @@ class Context:
# Create directories
self.__init_out_dirs()
self.__init_env()
def cleanup(self):
# Do not use in __del__:
# http://docs.python.org/reference/datamodel.html#customization
@ -101,6 +104,7 @@ class Context:
def __init_env(self):
"""Setup environment"""
os.environ['__cdist_out_dir'] = self.out_dir
os.environ['__cdist_base_dir'] = self.base_dir
def __init_out_dirs(self):
"""Initialise output directory structure"""