context: Add support for relative KAS_WORK/BUILD/REPO_REF_DIR paths
No one asked for this so far but the result of providing a relative path, e.g. to KAS_WORK_DIR, is so confusing that it is better to simply resolve all those vars to absolute paths. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
parent
ff99bf2226
commit
4c81f96742
@ -71,11 +71,13 @@ class Context:
|
|||||||
Implements the kas build context.
|
Implements the kas build context.
|
||||||
"""
|
"""
|
||||||
def __init__(self, args):
|
def __init__(self, args):
|
||||||
self.__kas_work_dir = os.environ.get('KAS_WORK_DIR', os.getcwd())
|
work_dir = os.environ.get('KAS_WORK_DIR', os.getcwd())
|
||||||
self.__kas_build_dir = os.environ.get('KAS_BUILD_DIR',
|
self.__kas_work_dir = os.path.abspath(work_dir)
|
||||||
os.path.join(self.__kas_work_dir,
|
build_dir = os.environ.get('KAS_BUILD_DIR',
|
||||||
'build'))
|
os.path.join(self.__kas_work_dir, 'build'))
|
||||||
self.__kas_repo_ref_dir = os.environ.get('KAS_REPO_REF_DIR', None)
|
self.__kas_build_dir = os.path.abspath(build_dir)
|
||||||
|
ref_dir = os.environ.get('KAS_REPO_REF_DIR', None)
|
||||||
|
self.__kas_repo_ref_dir = os.path.abspath(ref_dir) if ref_dir else None
|
||||||
self.setup_initial_environ()
|
self.setup_initial_environ()
|
||||||
self.config = None
|
self.config = None
|
||||||
self.args = args
|
self.args = args
|
||||||
|
Loading…
Reference in New Issue
Block a user