s4-waf: replace TOUCH_FILE() with normal install rules
authorAndrew Tridgell <tridge@samba.org>
Mon, 5 Apr 2010 01:25:20 +0000 (11:25 +1000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 6 Apr 2010 10:27:26 +0000 (20:27 +1000)
this allows it to work with 'waf uninstall'

buildtools/wafsamba/samba_utils.py
buildtools/wafsamba/wafsamba.py
lib/wscript_build

index fc23aa4f64b8e8954f9c1f8090e3df0e0e1822eb..8a8a7e39752fa60f2883757f2767711a669562b5 100644 (file)
@@ -409,19 +409,6 @@ def IS_NEWER(bld, file1, file2):
 Build.BuildContext.IS_NEWER = IS_NEWER
 
 
-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()
-
-
-
 @conf
 def RECURSE(ctx, directory):
     '''recurse into a directory, relative to the curdir or top level'''
index 55dfe26b0a465bbe474eff2b27c2ce50686574f0..a28f1ebb79f36e5cff9677b7317953acb836162d 100644 (file)
@@ -411,7 +411,7 @@ def SAMBA_SUBSYSTEM(bld, modname, source,
 Build.BuildContext.SAMBA_SUBSYSTEM = SAMBA_SUBSYSTEM
 
 
-def SAMBA_GENERATOR(bld, name, rule, source, target,
+def SAMBA_GENERATOR(bld, name, rule, source='', target='',
                     group='generators', enabled=True,
                     public_headers=None,
                     header_path=None,
index 44bf8108c8341e8a5fce0e8fbfd42214301c099e..f6fbe7a8802df43fad3690ea196f9f6c4815e62c 100644 (file)
@@ -21,7 +21,8 @@ for e in list:
     bld.INSTALL_WILDCARD('${PYTHONDIR}/samba/external', e + '/**/*', flat=False,
                          exclude='*.pyc', trim_path=os.path.dirname(e))
 
-if Options.is_install:
-    # we need a blank __init__.py in samba/external
-    TOUCH_FILE(bld.EXPAND_VARIABLES('${PYTHONDIR}/samba/external/__init__.py'),
-               install_dir=True)
+bld.SAMBA_GENERATOR('external_init_py',
+                    rule='touch ${TGT}',
+                    target='empty_file')
+
+bld.INSTALL_FILES('${PYTHONDIR}/samba/external', 'empty_file', destname='__init__.py')