From 52a1f6e08f2e3e92952c8dc18770be53b5a8a97c Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Sat, 24 Oct 2015 10:33:39 +0200 Subject: [PATCH] build:wafsamba: Remove hard-coded class names Using hard-coded class names prevents subclassing and make it hard to reason about the workflow. The wscript files read during the build must be read during the installation phase as well. Signed-off-by: Thomas Nagy Reviewed-by: Reviewed-by: --- buildtools/wafsamba/samba_utils.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py index e6e7901..d351971 100644 --- a/buildtools/wafsamba/samba_utils.py +++ b/buildtools/wafsamba/samba_utils.py @@ -1,11 +1,11 @@ # a waf tool to add autoconf-like macros to the configure section # and for SAMBA_ macros for building libraries, binaries etc -import Build, os, sys, Options, Utils, Task, re, fnmatch, Logs +import os, sys, re, fnmatch, shlex +import Build, Configure, Options, Utils, Task, Logs from TaskGen import feature, before from Configure import conf, ConfigurationContext from Logs import debug -import shlex # TODO: make this a --option LIB_PATH="shared" @@ -657,11 +657,10 @@ def PROCESS_SEPARATE_RULE(self, rule): You should have file named wscript__rule in the current directory where stage is either 'configure' or 'build' ''' - ctxclass = self.__class__.__name__ stage = '' - if ctxclass == 'ConfigurationContext': + if isinstance(self, Configure.ConfigurationContext): stage = 'configure' - elif ctxclass == 'BuildContext': + elif isinstance(self, Build.BuildContext): stage = 'build' file_path = os.path.join(self.curdir, WSCRIPT_FILE+'_'+stage+'_'+rule) txt = load_file(file_path)