From 5d99786151a6ed10baa85173c2a4e35a1db76097 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Thu, 13 Apr 2017 18:45:50 +0200 Subject: [PATCH] build:wafsamba: Update dist/distcheck commands Signed-off-by: Thomas Nagy Reviewed-by: Alexander Bokovoy Reviewed-by: Andrew Bartlett --- buildtools/wafsamba/samba_dist.py | 31 +++++++++++++++++++++++++++++++ wscript | 3 --- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/buildtools/wafsamba/samba_dist.py b/buildtools/wafsamba/samba_dist.py index 5c931a9974d..06c973a72a1 100644 --- a/buildtools/wafsamba/samba_dist.py +++ b/buildtools/wafsamba/samba_dist.py @@ -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 6dffeb9db37..b441849f76b 100644 --- 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''' -- 2.34.1