build: fixed DESTDIR for TOUCH_FILE()
authorAndrew Tridgell <tridge@samba.org>
Sat, 3 Apr 2010 11:46:32 +0000 (22:46 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 6 Apr 2010 10:27:24 +0000 (20:27 +1000)
buildtools/wafsamba/samba_utils.py
lib/wscript_build

index 5637a305d0d5482fb7ef50fb09aa88cc3769f452..07a37aa9e7be87e29cdfff1b3497618f04a07292 100644 (file)
@@ -408,8 +408,13 @@ def IS_NEWER(bld, file1, file2):
 Build.BuildContext.IS_NEWER = IS_NEWER
 
 
-def TOUCH_FILE(file):
+def TOUCH_FILE(file, install_dir=False):
     '''touch a file'''
+    if install_dir:
+        if file[0] == '/':
+            file = Options.options.destdir + file
+        else:
+            file = Options.options.destdir + '/' + file
     mkdir_p(os.path.dirname(file))
     f = open(file, 'w')
     f.close()
index b8bc9e9120d7801dade0c16ca5ccb564c6e4566c..44bf8108c8341e8a5fce0e8fbfd42214301c099e 100644 (file)
@@ -23,4 +23,5 @@ for e in list:
 
 if Options.is_install:
     # we need a blank __init__.py in samba/external
-    TOUCH_FILE(bld.EXPAND_VARIABLES('${PYTHONDIR}/samba/external/__init__.py'))
+    TOUCH_FILE(bld.EXPAND_VARIABLES('${PYTHONDIR}/samba/external/__init__.py'),
+               install_dir=True)