From d57ec5006c3422df97ddf3b85806160cb4ea08c0 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Wed, 28 Oct 2015 21:04:28 +0100 Subject: [PATCH] build:wafsamba: Removed hard-coded class names from build scripts 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 --- buildtools/wafsamba/samba_utils.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py index f7bb11c..36d3929 100644 --- a/buildtools/wafsamba/samba_utils.py +++ b/buildtools/wafsamba/samba_utils.py @@ -2,7 +2,7 @@ # and for SAMBA_ macros for building libraries, binaries etc import os, sys, re, fnmatch, shlex -import Build, Options, Utils, Task, Logs +import Build, Options, Utils, Task, Logs, Configure from TaskGen import feature, before from Configure import conf, ConfigurationContext from Logs import debug @@ -656,11 +656,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)