The branch, master has been updated via 2666d06 build:wafsamba: removed most import * statements via 859e341 lib: util: Make non-critical message a warning. from 86111fc ctdb-scripts: Fix an incorrect comment
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 2666d06f292303a57643a8ced87b8a91df2ffce1 Author: Thomas Nagy <tn...@waf.io> Date: Tue Oct 27 20:46:46 2015 +0100 build:wafsamba: removed most import * statements The 'import *' statements make it more difficult to reason about the modules and tends to conceal bugs. These changes enable running pyflakes against most of the build scripts. Signed-off-by: Thomas Nagy <tn...@waf.io> Reviewed-by: Andrew Bartlet <abart...@samba.org> Reviewed-by: Andreas Schneider <a...@samba.org> Autobuild-User(master): Andreas Schneider <a...@cryptomilk.org> Autobuild-Date(master): Wed Oct 28 12:52:17 CET 2015 on sn-devel-104 commit 859e3415b38538ff6c023e4a56570d94a4fe4432 Author: Jeremy Allison <j...@samba.org> Date: Tue Oct 27 17:08:50 2015 -0700 lib: util: Make non-critical message a warning. Non-root utilities (e.g. bin/net) call this via messaging_init(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=11566 Signed-off-by: Jeremy Allison <j...@samba.org> Reviewed-by: Andreas Schneider <a...@samba.org> ----------------------------------------------------------------------- Summary of changes: buildtools/wafsamba/configure_file.py | 3 ++- buildtools/wafsamba/nothreads.py | 7 +++---- buildtools/wafsamba/pkgconfig.py | 5 +++-- buildtools/wafsamba/samba_autoconf.py | 8 ++++---- buildtools/wafsamba/samba_autoproto.py | 3 ++- buildtools/wafsamba/samba_bundled.py | 5 +++-- buildtools/wafsamba/samba_conftests.py | 6 +++--- buildtools/wafsamba/samba_cross.py | 4 ++-- buildtools/wafsamba/samba_deps.py | 11 ++++++++--- buildtools/wafsamba/samba_dist.py | 6 ++++-- buildtools/wafsamba/samba_headers.py | 5 +++-- buildtools/wafsamba/samba_install.py | 6 +++--- buildtools/wafsamba/samba_patterns.py | 4 +--- buildtools/wafsamba/samba_perl.py | 3 +-- buildtools/wafsamba/samba_pidl.py | 9 ++++----- buildtools/wafsamba/samba_python.py | 6 ++---- buildtools/wafsamba/samba_third_party.py | 4 ++-- buildtools/wafsamba/samba_utils.py | 5 ++--- buildtools/wafsamba/samba_wildcard.py | 8 ++++---- buildtools/wafsamba/symbols.py | 7 ++++--- buildtools/wafsamba/wafsamba.py | 1 + buildtools/wafsamba/wscript | 6 +++--- lib/util/util.c | 4 ++-- pidl/wscript | 5 +---- 24 files changed, 67 insertions(+), 64 deletions(-) Changeset truncated at 500 lines: diff --git a/buildtools/wafsamba/configure_file.py b/buildtools/wafsamba/configure_file.py index 21264cf..e28282b 100644 --- a/buildtools/wafsamba/configure_file.py +++ b/buildtools/wafsamba/configure_file.py @@ -1,7 +1,8 @@ # handle substitution of variables in .in files +import re, os import Build, sys, Logs -from samba_utils import * +from samba_utils import SUBST_VARS_RECURSIVE def subst_at_vars(task): '''substiture @VAR@ style variables in a file''' diff --git a/buildtools/wafsamba/nothreads.py b/buildtools/wafsamba/nothreads.py index 075dcd3..d194eb8 100644 --- a/buildtools/wafsamba/nothreads.py +++ b/buildtools/wafsamba/nothreads.py @@ -10,12 +10,11 @@ "Execute the tasks" -import sys, random, time, threading, traceback, os +import sys, random, threading try: from Queue import Queue except ImportError: from queue import Queue -import Build, Utils, Logs, Options -from Logs import debug, error -from Constants import * +import Utils, Options +from Constants import EXCEPTION, CRASHED, MAXJOBS, ASK_LATER, SKIPPED, SKIP_ME, SUCCESS GAP = 15 diff --git a/buildtools/wafsamba/pkgconfig.py b/buildtools/wafsamba/pkgconfig.py index c837804..25cec78 100644 --- a/buildtools/wafsamba/pkgconfig.py +++ b/buildtools/wafsamba/pkgconfig.py @@ -1,7 +1,8 @@ # handle substitution of variables in pc files -import Build, sys, Logs -from samba_utils import * +import os, re, sys +import Build, Logs +from samba_utils import SUBST_VARS_RECURSIVE, TO_LIST def subst_at_vars(task): '''substiture @VAR@ style variables in a file''' diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py index d7273f9..296f9fb 100644 --- a/buildtools/wafsamba/samba_autoconf.py +++ b/buildtools/wafsamba/samba_autoconf.py @@ -1,10 +1,10 @@ # a waf tool to add autoconf-like macros to the configure section -import Build, os, sys, Options, preproc, Logs -import string +import os, sys +import Build, Options, preproc, Logs from Configure import conf -from samba_utils import * -import samba_cross +from TaskGen import feature +from samba_utils import TO_LIST, GET_TARGET_TYPE, SET_TARGET_TYPE, runonce, unique_list, mkdir_p missing_headers = set() diff --git a/buildtools/wafsamba/samba_autoproto.py b/buildtools/wafsamba/samba_autoproto.py index bad627a..b2b5233 100644 --- a/buildtools/wafsamba/samba_autoproto.py +++ b/buildtools/wafsamba/samba_autoproto.py @@ -1,7 +1,8 @@ # waf build tool for building automatic prototypes from C source +import os import Build -from samba_utils import * +from samba_utils import SET_TARGET_TYPE, os_path_relpath def SAMBA_AUTOPROTO(bld, header, source): '''rule for samba prototype generation''' diff --git a/buildtools/wafsamba/samba_bundled.py b/buildtools/wafsamba/samba_bundled.py index c8bfcd2..a4f841b 100644 --- a/buildtools/wafsamba/samba_bundled.py +++ b/buildtools/wafsamba/samba_bundled.py @@ -1,8 +1,9 @@ # functions to support bundled libraries +import sys +import Build, Options, Logs from Configure import conf -import sys, Logs -from samba_utils import * +from samba_utils import TO_LIST, runonce def PRIVATE_NAME(bld, name, private_extension, private_library): '''possibly rename a library to include a bundled extension''' diff --git a/buildtools/wafsamba/samba_conftests.py b/buildtools/wafsamba/samba_conftests.py index 9c0b651..5a9c9d5 100644 --- a/buildtools/wafsamba/samba_conftests.py +++ b/buildtools/wafsamba/samba_conftests.py @@ -1,11 +1,11 @@ # a set of config tests that use the samba_autoconf functions # to test for commonly needed configuration options -import os, shutil, re -import Build, Configure, Utils +import os, shutil, re, shlex +import Build, Configure, Utils, Options, Logs from Configure import conf import config_c -from samba_utils import * +from samba_utils import TO_LIST, ADD_LD_LIBRARY_PATH def add_option(self, *k, **kw): diff --git a/buildtools/wafsamba/samba_cross.py b/buildtools/wafsamba/samba_cross.py index ed3af1e..b8f2000 100644 --- a/buildtools/wafsamba/samba_cross.py +++ b/buildtools/wafsamba/samba_cross.py @@ -1,8 +1,8 @@ # functions for handling cross-compilation -import Utils, Logs, sys, os, Options, re +import os, sys, re, shlex +import Utils, Logs, Options from Configure import conf -import shlex real_Popen = None diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py index 606de41..f869dee 100644 --- a/buildtools/wafsamba/samba_deps.py +++ b/buildtools/wafsamba/samba_deps.py @@ -1,9 +1,14 @@ # Samba automatic dependency handling and project rules -import Build, os, sys, re, Environment, Logs, time -from samba_utils import * -from samba_autoconf import * +import os, sys, re, time + +import Build, Environment, Options, Logs, Utils +from Logs import debug +from Configure import conf + from samba_bundled import BUILTIN_LIBRARY +from samba_utils import LOCAL_CACHE, TO_LIST, get_tgt_list, unique_list, os_path_relpath +from samba_autoconf import library_flags @conf def ADD_GLOBAL_DEPENDENCY(ctx, dep): diff --git a/buildtools/wafsamba/samba_dist.py b/buildtools/wafsamba/samba_dist.py index 654a168..dbcb02a 100644 --- a/buildtools/wafsamba/samba_dist.py +++ b/buildtools/wafsamba/samba_dist.py @@ -1,8 +1,10 @@ # customised version of 'waf dist' for Samba tools # uses git ls-files to get file lists -import Utils, os, sys, tarfile, stat, Scripting, Logs, Options -from samba_utils import * +import os, sys, tarfile +import Utils, Scripting, Logs, Options +from Configure import conf +from samba_utils import os_path_relpath dist_dirs = None dist_files = None diff --git a/buildtools/wafsamba/samba_headers.py b/buildtools/wafsamba/samba_headers.py index 50ccad7..0a80082 100644 --- a/buildtools/wafsamba/samba_headers.py +++ b/buildtools/wafsamba/samba_headers.py @@ -1,7 +1,8 @@ # specialist handling of header files for Samba -import Build, re, Task, TaskGen, shutil, sys, Logs -from samba_utils import * +import os, re, sys, fnmatch +import Build, Logs, Utils +from samba_utils import TO_LIST, os_path_relpath def header_install_path(header, header_path): diff --git a/buildtools/wafsamba/samba_install.py b/buildtools/wafsamba/samba_install.py index 3d0c23a..5f399f9 100644 --- a/buildtools/wafsamba/samba_install.py +++ b/buildtools/wafsamba/samba_install.py @@ -3,9 +3,10 @@ # with all the configure options that affect rpath and shared # library use -import Options +import os +import Options, Utils from TaskGen import feature, before, after -from samba_utils import * +from samba_utils import LIB_PATH, MODE_755, install_rpath, build_rpath @feature('install_bin') @after('apply_core') @@ -224,7 +225,6 @@ def symlink_bin(self): if self.target.endswith('.inst'): return - blddir = os.path.dirname(self.bld.srcnode.abspath(self.bld.env)) if not self.link_task.outputs or not self.link_task.outputs[0]: raise Utils.WafError('no outputs found for %s in symlink_bin' % self.name) binpath = self.link_task.outputs[0].abspath(self.env) diff --git a/buildtools/wafsamba/samba_patterns.py b/buildtools/wafsamba/samba_patterns.py index 5183e86..9c6d499 100644 --- a/buildtools/wafsamba/samba_patterns.py +++ b/buildtools/wafsamba/samba_patterns.py @@ -1,8 +1,6 @@ # a waf tool to add extension based build patterns for Samba -import Task -from TaskGen import extension -from samba_utils import * +import Build from wafsamba import samba_version_file def write_version_header(task): diff --git a/buildtools/wafsamba/samba_perl.py b/buildtools/wafsamba/samba_perl.py index 3909aba..c07387a 100644 --- a/buildtools/wafsamba/samba_perl.py +++ b/buildtools/wafsamba/samba_perl.py @@ -1,5 +1,4 @@ -import Build -from samba_utils import * +import Utils from Configure import conf done = {} diff --git a/buildtools/wafsamba/samba_pidl.py b/buildtools/wafsamba/samba_pidl.py index abf6e9c..9651e4d 100644 --- a/buildtools/wafsamba/samba_pidl.py +++ b/buildtools/wafsamba/samba_pidl.py @@ -1,8 +1,9 @@ # waf build tool for building IDL files with pidl -from TaskGen import before -import Build, os, sys, Logs -from samba_utils import * +import os +import Build +from TaskGen import feature, before +from samba_utils import SET_TARGET_TYPE, TO_LIST, LOCAL_CACHE def SAMBA_PIDL(bld, pname, source, options='', @@ -112,7 +113,6 @@ Build.BuildContext.SAMBA_PIDL_LIST = SAMBA_PIDL_LIST ################################################################# # the rule for generating the NDR tables -from TaskGen import feature, before @feature('collect') @before('exec_rule') def collect(self): @@ -128,7 +128,6 @@ def collect(self): def SAMBA_PIDL_TABLES(bld, name, target): '''generate the pidl NDR tables file''' - headers = bld.env.PIDL_HEADERS bld.SET_BUILD_GROUP('main') t = bld( features = 'collect', diff --git a/buildtools/wafsamba/samba_python.py b/buildtools/wafsamba/samba_python.py index a8f780f..6f94350 100644 --- a/buildtools/wafsamba/samba_python.py +++ b/buildtools/wafsamba/samba_python.py @@ -1,9 +1,7 @@ # waf build tool for building IDL files with pidl -import Build -from samba_utils import * -from samba_autoconf import * - +import os +import Build, Logs, Utils from Configure import conf @conf diff --git a/buildtools/wafsamba/samba_third_party.py b/buildtools/wafsamba/samba_third_party.py index 46a1b94..8cfa4df 100644 --- a/buildtools/wafsamba/samba_third_party.py +++ b/buildtools/wafsamba/samba_third_party.py @@ -1,8 +1,8 @@ # functions to support third party libraries +import os +import Utils, Build from Configure import conf -import sys, Logs, os -from samba_bundled import * @conf def CHECK_FOR_THIRD_PARTY(conf): diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py index e6e7901..f7bb11c 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, 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" @@ -140,7 +140,6 @@ def exec_command(self, cmd, **kw): '''this overrides the 'waf -v' debug output to be in a nice unix like format instead of a python list. Thanks to ita on #waf for this''' - import Utils, Logs _cmd = cmd if isinstance(cmd, list): _cmd = ' '.join(cmd) diff --git a/buildtools/wafsamba/samba_wildcard.py b/buildtools/wafsamba/samba_wildcard.py index 84503b8..3d87481 100644 --- a/buildtools/wafsamba/samba_wildcard.py +++ b/buildtools/wafsamba/samba_wildcard.py @@ -1,9 +1,9 @@ # based on playground/evil in the waf svn tree -import os, datetime -import Scripting, Utils, Options, Logs, Environment, fnmatch -from Constants import * -from samba_utils import * +import os, datetime, fnmatch +import Scripting, Utils, Options, Logs, Environment +from Constants import SRCDIR, BLDDIR +from samba_utils import LOCAL_CACHE, os_path_relpath def run_task(t, k): '''run a single build task''' diff --git a/buildtools/wafsamba/symbols.py b/buildtools/wafsamba/symbols.py index d37cce2..7ff4bac 100644 --- a/buildtools/wafsamba/symbols.py +++ b/buildtools/wafsamba/symbols.py @@ -1,9 +1,10 @@ # a waf tool to extract symbols from object files or libraries # using nm, producing a set of exposed defined/undefined symbols -import Utils, Build, subprocess, Logs, re -from samba_wildcard import fake_build_environment -from samba_utils import * +import os, re, subprocess +import Utils, Build, Options, Logs +from Logs import debug +from samba_utils import TO_LIST, LOCAL_CACHE, get_tgt_list, os_path_relpath # these are the data structures used in symbols.py: # diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index ef9d430..fdd0371 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -20,6 +20,7 @@ from samba_perl import * from samba_deps import * from samba_bundled import * from samba_third_party import * +import samba_cross import samba_install import samba_conftests import samba_abi diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript index 5bce17d..69c556c 100755 --- a/buildtools/wafsamba/wscript +++ b/buildtools/wafsamba/wscript @@ -2,9 +2,9 @@ # this is a base set of waf rules that everything else pulls in first -import sys, wafsamba, Configure, Logs -import Options, os, preproc -from samba_utils import * +import os, sys +import wafsamba, Configure, Logs, Options, Utils +from samba_utils import os_path_relpath from optparse import SUPPRESS_HELP # this forces configure to be re-run if any of the configure diff --git a/lib/util/util.c b/lib/util/util.c index 393d83d..d8a84da 100644 --- a/lib/util/util.c +++ b/lib/util/util.c @@ -275,8 +275,8 @@ _PUBLIC_ bool directory_create_or_exist_strict(const char *dname, return false; } if (st.st_uid != uid && !uid_wrapper_enabled()) { - DEBUG(0, ("invalid ownership on directory " - "%s\n", dname)); + DBG_NOTICE("invalid ownership on directory " + "%s\n", dname); return false; } if ((st.st_mode & 0777) != dir_perms) { diff --git a/pidl/wscript b/pidl/wscript index 27cb230..f4ff902 100644 --- a/pidl/wscript +++ b/pidl/wscript @@ -1,13 +1,12 @@ #!/usr/bin/env python -import os, sys, Logs +import os, Logs from samba_utils import MODE_755 # This function checks if a perl module is installed on the system. def check_system_perl_module(conf, module, version=None): bundle_name = module.replace('::', '_') module_check = module - found = False # Create module string with version if version: @@ -65,8 +64,6 @@ def build(bld): # use perl to build the manpages bld.env.pidl_srcdir = os.path.join(bld.srcnode.abspath(), 'pidl') - blib_bld = os.path.join(bld.srcnode.abspath(bld.env), 'pidl/blib') - bld.SET_BUILD_GROUP('final') if 'POD2MAN' in bld.env and bld.env['POD2MAN'] != '': for src, manpage in pidl_manpages.iteritems(): -- Samba Shared Repository