aboutsummaryrefslogtreecommitdiffstats
path: root/buildtools/wafsamba
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2017-09-12 15:56:44 +0200
committerJeremy Allison <jra@samba.org>2017-09-16 04:47:29 +0200
commite5a2e6291a88757eae7a9e7ad58d8465c0509896 (patch)
tree4d4a6ff29381ba64c3d8b9dca030d4e885980d6f /buildtools/wafsamba
parent05169a6047e6e3271949c96652a667f624e9a62d (diff)
downloadsamba-e5a2e6291a88757eae7a9e7ad58d8465c0509896.tar.gz
samba-e5a2e6291a88757eae7a9e7ad58d8465c0509896.tar.xz
samba-e5a2e6291a88757eae7a9e7ad58d8465c0509896.zip
wafsamba: We need to honor DESTDIR in INSTALL_DIR
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12957 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Sep 16 04:47:29 CEST 2017 on sn-devel-144
Diffstat (limited to 'buildtools/wafsamba')
-rw-r--r--buildtools/wafsamba/wafsamba.py17
1 files changed, 9 insertions, 8 deletions
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