The branch, master has been updated via 209d3c0 tests/source: Add wafsamba/ files to list of Python files to check. via 88a041a wafsamba: Expand tabs. from 744ed53 gensec: Fix a memory corruption in gensec_use_kerberos_mechs
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 209d3c0b7187f2c4e6be5a972206094cdf70224f Author: Jelmer Vernooij <jel...@samba.org> Date: Thu Feb 9 13:12:06 2012 +0100 tests/source: Add wafsamba/ files to list of Python files to check. Autobuild-User: Jelmer Vernooij <jel...@samba.org> Autobuild-Date: Fri Feb 10 01:45:16 CET 2012 on sn-devel-104 commit 88a041aa21c520fef46fae5a7db8958d4202cc8f Author: Jelmer Vernooij <jel...@samba.org> Date: Thu Feb 9 13:08:31 2012 +0100 wafsamba: Expand tabs. ----------------------------------------------------------------------- Summary of changes: buildtools/wafsamba/gccdeps.py | 182 ++++++------ buildtools/wafsamba/generic_cc.py | 68 +++--- buildtools/wafsamba/irixcc.py | 96 +++--- buildtools/wafsamba/nothreads.py | 362 ++++++++++++------------ buildtools/wafsamba/samba3.py | 18 +- buildtools/wafsamba/samba_conftests.py | 2 +- buildtools/wafsamba/samba_optimisation.py | 156 +++++----- buildtools/wafsamba/samba_pidl.py | 4 +- buildtools/wafsamba/samba_wildcard.py | 210 +++++++------- buildtools/wafsamba/tru64cc.py | 96 +++--- source4/scripting/python/samba/tests/source.py | 18 +- 11 files changed, 613 insertions(+), 599 deletions(-) Changeset truncated at 500 lines: diff --git a/buildtools/wafsamba/gccdeps.py b/buildtools/wafsamba/gccdeps.py index 6600c9c..2f09083 100644 --- a/buildtools/wafsamba/gccdeps.py +++ b/buildtools/wafsamba/gccdeps.py @@ -18,111 +18,111 @@ preprocessor_flag = '-MD' @feature('cc') @before('apply_core') def add_mmd_cc(self): - if self.env.get_flat('CCFLAGS').find(preprocessor_flag) < 0: - self.env.append_value('CCFLAGS', preprocessor_flag) + if self.env.get_flat('CCFLAGS').find(preprocessor_flag) < 0: + self.env.append_value('CCFLAGS', preprocessor_flag) @feature('cxx') @before('apply_core') def add_mmd_cxx(self): - if self.env.get_flat('CXXFLAGS').find(preprocessor_flag) < 0: - self.env.append_value('CXXFLAGS', preprocessor_flag) + if self.env.get_flat('CXXFLAGS').find(preprocessor_flag) < 0: + self.env.append_value('CXXFLAGS', preprocessor_flag) def scan(self): - "the scanner does not do anything initially" - nodes = self.generator.bld.node_deps.get(self.unique_id(), []) - names = [] - return (nodes, names) + "the scanner does not do anything initially" + nodes = self.generator.bld.node_deps.get(self.unique_id(), []) + names = [] + return (nodes, names) re_o = re.compile("\.o$") re_src = re.compile("^(\.\.)[\\/](.*)$") def post_run(self): - # The following code is executed by threads, it is not safe, so a lock is needed... - - if getattr(self, 'cached', None): - return Task.Task.post_run(self) - - name = self.outputs[0].abspath(self.env) - name = re_o.sub('.d', name) - txt = Utils.readf(name) - #os.unlink(name) - - txt = txt.replace('\\\n', '') - - lst = txt.strip().split(':') - val = ":".join(lst[1:]) - val = val.split() - - nodes = [] - bld = self.generator.bld - - f = re.compile("^("+self.env.variant()+"|\.\.)[\\/](.*)$") - for x in val: - if os.path.isabs(x): - - if not preproc.go_absolute: - continue - - lock.acquire() - try: - node = bld.root.find_resource(x) - finally: - lock.release() - else: - g = re.search(re_src, x) - if g: - x = g.group(2) - lock.acquire() - try: - node = bld.bldnode.parent.find_resource(x) - finally: - lock.release() - else: - g = re.search(f, x) - if g: - x = g.group(2) - lock.acquire() - try: - node = bld.srcnode.find_resource(x) - finally: - lock.release() - - if id(node) == id(self.inputs[0]): - # ignore the source file, it is already in the dependencies - # this way, successful config tests may be retrieved from the cache - continue - - if not node: - raise ValueError('could not find %r for %r' % (x, self)) - else: - nodes.append(node) - - Logs.debug('deps: real scanner for %s returned %s' % (str(self), str(nodes))) - - bld.node_deps[self.unique_id()] = nodes - bld.raw_deps[self.unique_id()] = [] - - try: - del self.cache_sig - except: - pass - - Task.Task.post_run(self) + # The following code is executed by threads, it is not safe, so a lock is needed... + + if getattr(self, 'cached', None): + return Task.Task.post_run(self) + + name = self.outputs[0].abspath(self.env) + name = re_o.sub('.d', name) + txt = Utils.readf(name) + #os.unlink(name) + + txt = txt.replace('\\\n', '') + + lst = txt.strip().split(':') + val = ":".join(lst[1:]) + val = val.split() + + nodes = [] + bld = self.generator.bld + + f = re.compile("^("+self.env.variant()+"|\.\.)[\\/](.*)$") + for x in val: + if os.path.isabs(x): + + if not preproc.go_absolute: + continue + + lock.acquire() + try: + node = bld.root.find_resource(x) + finally: + lock.release() + else: + g = re.search(re_src, x) + if g: + x = g.group(2) + lock.acquire() + try: + node = bld.bldnode.parent.find_resource(x) + finally: + lock.release() + else: + g = re.search(f, x) + if g: + x = g.group(2) + lock.acquire() + try: + node = bld.srcnode.find_resource(x) + finally: + lock.release() + + if id(node) == id(self.inputs[0]): + # ignore the source file, it is already in the dependencies + # this way, successful config tests may be retrieved from the cache + continue + + if not node: + raise ValueError('could not find %r for %r' % (x, self)) + else: + nodes.append(node) + + Logs.debug('deps: real scanner for %s returned %s' % (str(self), str(nodes))) + + bld.node_deps[self.unique_id()] = nodes + bld.raw_deps[self.unique_id()] = [] + + try: + del self.cache_sig + except: + pass + + Task.Task.post_run(self) import Constants, Utils def sig_implicit_deps(self): - try: - return Task.Task.sig_implicit_deps(self) - except Utils.WafError: - return Constants.SIG_NIL + try: + return Task.Task.sig_implicit_deps(self) + except Utils.WafError: + return Constants.SIG_NIL for name in 'cc cxx'.split(): - try: - cls = Task.TaskBase.classes[name] - except KeyError: - pass - else: - cls.post_run = post_run - cls.scan = scan - cls.sig_implicit_deps = sig_implicit_deps + try: + cls = Task.TaskBase.classes[name] + except KeyError: + pass + else: + cls.post_run = post_run + cls.scan = scan + cls.sig_implicit_deps = sig_implicit_deps diff --git a/buildtools/wafsamba/generic_cc.py b/buildtools/wafsamba/generic_cc.py index ea277dc..504e902 100644 --- a/buildtools/wafsamba/generic_cc.py +++ b/buildtools/wafsamba/generic_cc.py @@ -14,50 +14,50 @@ c_compiler['hpux'] = ['gcc', 'generic_cc'] @conftest def find_generic_cc(conf): - v = conf.env - cc = None - if v['CC']: cc = v['CC'] - elif 'CC' in conf.environ: cc = conf.environ['CC'] - if not cc: cc = conf.find_program('cc', var='CC') - if not cc: conf.fatal('generic_cc was not found') - cc = conf.cmd_to_list(cc) - v['CC'] = cc - v['CC_NAME'] = 'generic' + v = conf.env + cc = None + if v['CC']: cc = v['CC'] + elif 'CC' in conf.environ: cc = conf.environ['CC'] + if not cc: cc = conf.find_program('cc', var='CC') + if not cc: conf.fatal('generic_cc was not found') + cc = conf.cmd_to_list(cc) + v['CC'] = cc + v['CC_NAME'] = 'generic' @conftest def generic_cc_common_flags(conf): - v = conf.env + v = conf.env - v['CC_SRC_F'] = '' - v['CC_TGT_F'] = ['-c', '-o', ''] - v['CPPPATH_ST'] = '-I%s' # template for adding include paths + v['CC_SRC_F'] = '' + v['CC_TGT_F'] = ['-c', '-o', ''] + v['CPPPATH_ST'] = '-I%s' # template for adding include paths - # linker - if not v['LINK_CC']: v['LINK_CC'] = v['CC'] - v['CCLNK_SRC_F'] = '' - v['CCLNK_TGT_F'] = ['-o', ''] + # linker + if not v['LINK_CC']: v['LINK_CC'] = v['CC'] + v['CCLNK_SRC_F'] = '' + v['CCLNK_TGT_F'] = ['-o', ''] - v['LIB_ST'] = '-l%s' # template for adding libs - v['LIBPATH_ST'] = '-L%s' # template for adding libpaths - v['STATICLIB_ST'] = '-l%s' - v['STATICLIBPATH_ST'] = '-L%s' - v['CCDEFINES_ST'] = '-D%s' + v['LIB_ST'] = '-l%s' # template for adding libs + v['LIBPATH_ST'] = '-L%s' # template for adding libpaths + v['STATICLIB_ST'] = '-l%s' + v['STATICLIBPATH_ST'] = '-L%s' + v['CCDEFINES_ST'] = '-D%s' -# v['SONAME_ST'] = '-Wl,-h -Wl,%s' -# v['SHLIB_MARKER'] = '-Bdynamic' -# v['STATICLIB_MARKER'] = '-Bstatic' +# v['SONAME_ST'] = '-Wl,-h -Wl,%s' +# v['SHLIB_MARKER'] = '-Bdynamic' +# v['STATICLIB_MARKER'] = '-Bstatic' - # program - v['program_PATTERN'] = '%s' + # program + v['program_PATTERN'] = '%s' - # shared library -# v['shlib_CCFLAGS'] = ['-Kpic', '-DPIC'] -# v['shlib_LINKFLAGS'] = ['-G'] - v['shlib_PATTERN'] = 'lib%s.so' + # shared library +# v['shlib_CCFLAGS'] = ['-Kpic', '-DPIC'] +# v['shlib_LINKFLAGS'] = ['-G'] + v['shlib_PATTERN'] = 'lib%s.so' - # static lib -# v['staticlib_LINKFLAGS'] = ['-Bstatic'] -# v['staticlib_PATTERN'] = 'lib%s.a' + # static lib +# v['staticlib_LINKFLAGS'] = ['-Bstatic'] +# v['staticlib_PATTERN'] = 'lib%s.a' detect = ''' find_generic_cc diff --git a/buildtools/wafsamba/irixcc.py b/buildtools/wafsamba/irixcc.py index 1461bf8..a7b0a74 100644 --- a/buildtools/wafsamba/irixcc.py +++ b/buildtools/wafsamba/irixcc.py @@ -13,57 +13,57 @@ c_compiler['irix'] = ['gcc', 'irixcc'] @conftest def find_irixcc(conf): - v = conf.env - cc = None - if v['CC']: cc = v['CC'] - elif 'CC' in conf.environ: cc = conf.environ['CC'] - if not cc: cc = conf.find_program('cc', var='CC') - if not cc: conf.fatal('irixcc was not found') - cc = conf.cmd_to_list(cc) - - try: - if Utils.cmd_output(cc + ['-version']) != '': - conf.fatal('irixcc %r was not found' % cc) - except ValueError: - conf.fatal('irixcc -v could not be executed') - - v['CC'] = cc - v['CC_NAME'] = 'irix' + v = conf.env + cc = None + if v['CC']: cc = v['CC'] + elif 'CC' in conf.environ: cc = conf.environ['CC'] + if not cc: cc = conf.find_program('cc', var='CC') + if not cc: conf.fatal('irixcc was not found') + cc = conf.cmd_to_list(cc) + + try: + if Utils.cmd_output(cc + ['-version']) != '': + conf.fatal('irixcc %r was not found' % cc) + except ValueError: + conf.fatal('irixcc -v could not be executed') + + v['CC'] = cc + v['CC_NAME'] = 'irix' @conftest def irixcc_common_flags(conf): - v = conf.env - - v['CC_SRC_F'] = '' - v['CC_TGT_F'] = ['-c', '-o', ''] - v['CPPPATH_ST'] = '-I%s' # template for adding include paths - - # linker - if not v['LINK_CC']: v['LINK_CC'] = v['CC'] - v['CCLNK_SRC_F'] = '' - v['CCLNK_TGT_F'] = ['-o', ''] - - v['LIB_ST'] = '-l%s' # template for adding libs - v['LIBPATH_ST'] = '-L%s' # template for adding libpaths - v['STATICLIB_ST'] = '-l%s' - v['STATICLIBPATH_ST'] = '-L%s' - v['CCDEFINES_ST'] = '-D%s' - -# v['SONAME_ST'] = '-Wl,-h -Wl,%s' -# v['SHLIB_MARKER'] = '-Bdynamic' -# v['STATICLIB_MARKER'] = '-Bstatic' - - # program - v['program_PATTERN'] = '%s' - - # shared library -# v['shlib_CCFLAGS'] = ['-Kpic', '-DPIC'] -# v['shlib_LINKFLAGS'] = ['-G'] - v['shlib_PATTERN'] = 'lib%s.so' - - # static lib -# v['staticlib_LINKFLAGS'] = ['-Bstatic'] -# v['staticlib_PATTERN'] = 'lib%s.a' + v = conf.env + + v['CC_SRC_F'] = '' + v['CC_TGT_F'] = ['-c', '-o', ''] + v['CPPPATH_ST'] = '-I%s' # template for adding include paths + + # linker + if not v['LINK_CC']: v['LINK_CC'] = v['CC'] + v['CCLNK_SRC_F'] = '' + v['CCLNK_TGT_F'] = ['-o', ''] + + v['LIB_ST'] = '-l%s' # template for adding libs + v['LIBPATH_ST'] = '-L%s' # template for adding libpaths + v['STATICLIB_ST'] = '-l%s' + v['STATICLIBPATH_ST'] = '-L%s' + v['CCDEFINES_ST'] = '-D%s' + +# v['SONAME_ST'] = '-Wl,-h -Wl,%s' +# v['SHLIB_MARKER'] = '-Bdynamic' +# v['STATICLIB_MARKER'] = '-Bstatic' + + # program + v['program_PATTERN'] = '%s' + + # shared library +# v['shlib_CCFLAGS'] = ['-Kpic', '-DPIC'] +# v['shlib_LINKFLAGS'] = ['-G'] + v['shlib_PATTERN'] = 'lib%s.so' + + # static lib +# v['staticlib_LINKFLAGS'] = ['-Bstatic'] +# v['staticlib_PATTERN'] = 'lib%s.a' detect = ''' find_irixcc diff --git a/buildtools/wafsamba/nothreads.py b/buildtools/wafsamba/nothreads.py index 9054a57..b39aeb5 100644 --- a/buildtools/wafsamba/nothreads.py +++ b/buildtools/wafsamba/nothreads.py @@ -22,195 +22,195 @@ GAP = 15 run_old = threading.Thread.run def run(*args, **kwargs): - try: - run_old(*args, **kwargs) - except (KeyboardInterrupt, SystemExit): - raise - except: - sys.excepthook(*sys.exc_info()) + try: + run_old(*args, **kwargs) + except (KeyboardInterrupt, SystemExit): + raise + except: + sys.excepthook(*sys.exc_info()) threading.Thread.run = run class TaskConsumer(object): - consumers = 1 + consumers = 1 def process(tsk): - m = tsk.master - if m.stop: - m.out.put(tsk) - return - - try: - tsk.generator.bld.printout(tsk.display()) - if tsk.__class__.stat: ret = tsk.__class__.stat(tsk) - # actual call to task's run() function - else: ret = tsk.call_run() - except Exception, e: - tsk.err_msg = Utils.ex_stack() - tsk.hasrun = EXCEPTION - - # TODO cleanup - m.error_handler(tsk) - m.out.put(tsk) - return - - if ret: - tsk.err_code = ret - tsk.hasrun = CRASHED - else: - try: - tsk.post_run() - except Utils.WafError: - pass - except Exception: - tsk.err_msg = Utils.ex_stack() - tsk.hasrun = EXCEPTION - else: - tsk.hasrun = SUCCESS - if tsk.hasrun != SUCCESS: - m.error_handler(tsk) - - m.out.put(tsk) + m = tsk.master + if m.stop: + m.out.put(tsk) + return + + try: + tsk.generator.bld.printout(tsk.display()) + if tsk.__class__.stat: ret = tsk.__class__.stat(tsk) + # actual call to task's run() function + else: ret = tsk.call_run() + except Exception, e: + tsk.err_msg = Utils.ex_stack() + tsk.hasrun = EXCEPTION + + # TODO cleanup + m.error_handler(tsk) + m.out.put(tsk) + return + + if ret: + tsk.err_code = ret + tsk.hasrun = CRASHED + else: + try: + tsk.post_run() + except Utils.WafError: + pass + except Exception: + tsk.err_msg = Utils.ex_stack() + tsk.hasrun = EXCEPTION -- Samba Shared Repository