From: Andreas Schneider Date: Tue, 12 Sep 2017 13:56:44 +0000 (+0200) Subject: wafsamba: We need to honor DESTDIR in INSTALL_DIR X-Git-Tag: ldb-1.3.0~205 X-Git-Url: http://git.samba.org/?p=samba.git;a=commitdiff_plain;h=e5a2e6291a88757eae7a9e7ad58d8465c0509896 wafsamba: We need to honor DESTDIR in INSTALL_DIR BUG: https://bugzilla.samba.org/show_bug.cgi?id=12957 Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Sat Sep 16 04:47:29 CEST 2017 on sn-devel-144 --- diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index f91adca1a0c..23fd3c48342 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -885,29 +885,30 @@ def INSTALL_WILDCARD(bld, destdir, pattern, chmod=MODE_644, flat=False, python_fixup=python_fixup, base_name=trim_path) Build.BuildContext.INSTALL_WILDCARD = INSTALL_WILDCARD -def INSTALL_DIR(bld, path, chmod=0o755): +def INSTALL_DIR(bld, path, chmod=0o755, env=None): """Install a directory if it doesn't exist, always set permissions.""" if not path: return [] + destpath = bld.get_install_path(path, env) + if bld.is_install > 0: - path = bld.EXPAND_VARIABLES(path) - if not os.path.isdir(path): + if not os.path.isdir(destpath): try: - os.makedirs(path) - os.chmod(path, chmod) + os.makedirs(destpath) + os.chmod(destpath, chmod) except OSError, e: - if not os.path.isdir(path): + if not os.path.isdir(destpath): raise Utils.WafError("Cannot create the folder '%s' (error: %s)" % (path, e)) Build.BuildContext.INSTALL_DIR = INSTALL_DIR -def INSTALL_DIRS(bld, destdir, dirs, chmod=0o755): +def INSTALL_DIRS(bld, destdir, dirs, chmod=0o755, env=None): '''install a set of directories''' destdir = bld.EXPAND_VARIABLES(destdir) dirs = bld.EXPAND_VARIABLES(dirs) for d in TO_LIST(dirs): - INSTALL_DIR(bld, os.path.join(destdir, d), chmod) + INSTALL_DIR(bld, os.path.join(destdir, d), chmod, env) Build.BuildContext.INSTALL_DIRS = INSTALL_DIRS