wafsamba: Only use $DESTDIR in INSTALL_DIR() if it is set
authorMartin Schwenke <martin@meltin.net>
Thu, 13 Sep 2018 00:54:48 +0000 (10:54 +1000)
committerMartin Schwenke <martins@samba.org>
Thu, 13 Sep 2018 07:37:23 +0000 (09:37 +0200)
Otherwise the leading '/' is stripped and directories are created
relative to the current directory.

This fixes a regression introduced in recent commit
26ea0f58daace4adef7c5bb17f19476083bf3b7b.

Reported-by: Ralph Böhme <slow@samba.org>
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Sep 13 09:37:23 CEST 2018 on sn-devel-144

buildtools/wafsamba/wafsamba.py

index dbcfe12aacac6ef71d54d3100ba3ccef012205d7..36bc6c36483a5cc8c41844d158916e3dc9f46e2f 100644 (file)
@@ -897,8 +897,9 @@ def INSTALL_DIR(bld, path, chmod=0o755, env=None):
     if not path:
         return []
 
-    destpath = os.path.join(Options.options.destdir,
-                            bld.EXPAND_VARIABLES(path).lstrip(os.sep))
+    destpath = bld.EXPAND_VARIABLES(path)
+    if Options.options.destdir:
+        destpath = os.path.join(Options.options.destdir, destpath.lstrip(os.sep))
 
     if bld.is_install > 0:
         if not os.path.isdir(destpath):