build:wafsamba: Update dist/distcheck commands
authorThomas Nagy <tnagy@waf.io>
Thu, 13 Apr 2017 16:45:50 +0000 (18:45 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 5 Sep 2018 04:37:21 +0000 (06:37 +0200)
Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
buildtools/wafsamba/samba_dist.py
wscript

index 5c931a9974d3d2c325e9332ab99e08b0d20b2252..06c973a72a1edda90a14a073486d5989ec642017 100644 (file)
@@ -5,10 +5,38 @@ import os, sys, tarfile
 import Utils, Scripting, Logs, Options
 from Configure import conf
 from samba_utils import os_path_relpath
+from waflib import Context
 
 dist_dirs = None
 dist_files = None
 dist_blacklist = ""
+dist_archive = None
+
+class Dist(Context.Context):
+    # TODO remove
+    cmd = 'dist'
+    fun = 'dist'
+    def execute(self):
+        Context.g_module.dist()
+
+class DistCheck(Scripting.DistCheck):
+    fun = 'distcheck'
+    cmd = 'distcheck'
+    def execute(self):
+        Options.options.distcheck_args = ''
+        if Context.g_module.distcheck is Scripting.distcheck:
+            # default
+            Context.g_module.distcheck(self)
+        else:
+            Context.g_module.distcheck()
+        Context.g_module.dist()
+        self.check()
+    def get_arch_name(self):
+        global dist_archive
+        return dist_archive
+    def make_distcheck_cmd(self, tmpdir):
+        waf = os.path.abspath(sys.argv[0])
+        return [sys.executable, waf, 'configure', 'build', 'install', 'uninstall', '--destdir=' + tmpdir]
 
 def add_symlink(tar, fname, abspath, basedir):
     '''handle symlinks to directories that may move during packaging'''
@@ -218,6 +246,9 @@ def dist(appname='', version=''):
     else:
         Logs.info('Created %s' % dist_name)
 
+    # TODO use the ctx object instead
+    global dist_archive
+    dist_archive = dist_name
     return dist_name
 
 
diff --git a/wscript b/wscript
index 6dffeb9db379d301d10a699abacbc8926f077661..b441849f76bd79c0684de9d3342ab8f9063cdc53 100644 (file)
--- a/wscript
+++ b/wscript
@@ -428,9 +428,6 @@ def dist():
 def distcheck():
     '''test that distribution tarball builds and installs'''
     samba_version.load_version(env=None)
-    import Scripting
-    d = Scripting.distcheck
-    d()
 
 def wildcard_cmd(cmd):
     '''called on a unknown command'''