1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-01 04:58:35 +03:00

buildtools/wafsamba: add install_dir to build context

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Alexander Bokovoy 2018-06-27 16:06:44 +03:00 committed by Andrew Bartlett
parent 69c655fe98
commit 3fc4786658

View File

@ -106,6 +106,23 @@ def undefine(self, key, from_env=True, comment=None):
if from_env:
self.env[key] = ()
def install_dir(self, path):
if not path:
return []
destpath = Utils.subst_vars(path, self.env)
if self.is_install > 0:
Logs.info('* creating %s', destpath)
Utils.check_dir(destpath)
elif self.is_install < 0:
Logs.info('* removing %s', destpath)
try:
os.remove(destpath)
except OSError:
pass
Build.BuildContext.install_dir = install_dir
class ConfigurationContext(Configure.ConfigurationContext):
def init_dirs(self):
self.setenv('default')