diff options
author | Thomas Nagy <tnagy1024@gmail.com> | 2010-04-08 07:45:46 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-04-08 07:46:39 +1000 |
commit | 7f3116a63d7d91f4c0d26adf8fcdef0a5a957971 (patch) | |
tree | 46e95f69b7637c38dbbc20455c3dc99408a93df7 /source4 | |
parent | 64957ce0686761acd2a2a7ec1787898d2d8238b6 (diff) | |
download | samba-7f3116a63d7d91f4c0d26adf8fcdef0a5a957971.tar.gz samba-7f3116a63d7d91f4c0d26adf8fcdef0a5a957971.tar.bz2 samba-7f3116a63d7d91f4c0d26adf8fcdef0a5a957971.zip |
build: allow the waf build to work with python 3.0 and 3.1
Python 3.x is a bit fussier about print statements and indentation.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/dynconfig/wscript | 4 | ||||
-rw-r--r-- | source4/scripting/wscript_build | 3 | ||||
-rw-r--r-- | source4/selftest/wscript | 8 | ||||
-rw-r--r-- | source4/setup/wscript_build | 3 | ||||
-rw-r--r-- | source4/wscript | 10 |
5 files changed, 15 insertions, 13 deletions
diff --git a/source4/dynconfig/wscript b/source4/dynconfig/wscript index 835fc64ad0..7a9f419add 100644 --- a/source4/dynconfig/wscript +++ b/source4/dynconfig/wscript @@ -62,7 +62,7 @@ def get_varname(v): if v.startswith('with-'): v = v[5:] v = v.upper() - v = string.replace(v, '-', '_') + v = v.replace('-', '_') return v @@ -101,7 +101,7 @@ def configure(conf): if (not Options.options.ENABLE_FHS and (conf.env.PREFIX == '/usr' or conf.env.PREFIX == '/usr/local')): - print "ERROR: Don't install directly under /usr or /usr/local without using the FHS option (--enable-fhs)" + print("ERROR: Don't install directly under /usr or /usr/local without using the FHS option (--enable-fhs)") sys.exit(1) diff --git a/source4/scripting/wscript_build b/source4/scripting/wscript_build index d48f24c681..5911364ce3 100644 --- a/source4/scripting/wscript_build +++ b/source4/scripting/wscript_build @@ -1,6 +1,7 @@ #!/usr/bin/env python +O755 = 493 bld.INSTALL_FILES('${SBINDIR}','bin/upgradeprovision bin/samba_dnsupdate', - chmod=0755, python_fixup=True, flat=True) + chmod=O755, python_fixup=True, flat=True) diff --git a/source4/selftest/wscript b/source4/selftest/wscript index 5f4216f0e2..a36b93561e 100644 --- a/source4/selftest/wscript +++ b/source4/selftest/wscript @@ -49,7 +49,7 @@ def cmd_testonly(opt): if (not CONFIG_SET(opt, 'NSS_WRAPPER') or not CONFIG_SET(opt, 'UID_WRAPPER') or not CONFIG_SET(opt, 'SOCKET_WRAPPER')): - print "ERROR: You must use --enable-selftest to enable selftest" + print("ERROR: You must use --enable-selftest to enable selftest") sys.exit(1) env.TESTS = Options.options.TESTS @@ -73,12 +73,12 @@ def cmd_testonly(opt): env.FILTER_OPTIONS = '${FILTER_XFAIL} | ${FORMAT_TEST_OUTPUT}' if Options.options.VALGRIND: - os.environ['VALGRIND'] = 'valgrind -q --num-callers=30' + os.environ['VALGRIND'] = 'valgrind -q --num-callers=30' if Options.options.VALGRINDLOG is not None: os.environ['VALGRIND'] += ' --log-file=%s' % Options.options.VALGRINDLOG if Options.options.VALGRIND_SERVER: - os.environ['SAMBA_VALGRIND'] = 'xterm -n server -e ../selftest/valgrind_run A=B ' + os.environ['SAMBA_VALGRIND'] = 'xterm -n server -e ../selftest/valgrind_run A=B ' env.SELFTEST_PREFIX = Options.options.SELFTEST_PREFIX @@ -95,7 +95,7 @@ def cmd_testonly(opt): cmd = '(${PERL} ../selftest/selftest.pl --prefix=${SELFTEST_PREFIX} --builddir=. --srcdir=. --exclude=./selftest/skip --testlist="./selftest/tests.sh|" ${OPTIONS} --socket-wrapper ${TESTS} && touch ${SELFTEST_PREFIX}/st_done) | ${FILTER_OPTIONS}' cmd = EXPAND_VARIABLES(opt, cmd) - print "test: running %s" % cmd + print("test: running %s" % cmd) ret = RUN_COMMAND(cmd, env=env) if ret != 0: print("ERROR: test failed with exit code %d" % ret) diff --git a/source4/setup/wscript_build b/source4/setup/wscript_build index ea06750aee..59112b8f36 100644 --- a/source4/setup/wscript_build +++ b/source4/setup/wscript_build @@ -3,7 +3,8 @@ bld.INSTALL_WILDCARD('${SETUPDIR}', 'ad-schema/*.txt') bld.INSTALL_WILDCARD('${SETUPDIR}', 'display-specifiers/*.txt') -bld.INSTALL_FILES('${SBINDIR}','provision', chmod=0755, python_fixup=True) +O755 = 493 +bld.INSTALL_FILES('${SBINDIR}','provision', chmod=O755, python_fixup=True) bld.INSTALL_FILES('${PRIVATEDIR}', 'dns_update_list') diff --git a/source4/wscript b/source4/wscript index a1ca61f0a1..d40d434397 100644 --- a/source4/wscript +++ b/source4/wscript @@ -89,7 +89,7 @@ def etags(ctx): import Utils source_root = os.path.dirname(Utils.g_module.root_path) cmd = 'etags $(find %s/.. -name "*.[ch]")' % source_root - print "Running: %s" % cmd + print("Running: %s" % cmd) os.system(cmd) def ctags(ctx): @@ -97,7 +97,7 @@ def ctags(ctx): import Utils source_root = os.path.dirname(Utils.g_module.root_path) cmd = 'ctags $(find %s/.. -name "*.[ch]" | grep -v "*_proto\.h")' % source_root - print "Running: %s" % cmd + print("Running: %s" % cmd) os.system(cmd) # putting this here enabled build in the list @@ -110,7 +110,7 @@ def build(bld): def pydoctor(ctx): '''build python apidocs''' cmd='LD_LIBRARY_PATH=bin/shared PYTHONPATH=bin/python pydoctor --project-name=Samba --project-url=http://www.samba.org --make-html --docformat=restructuredtext --add-package bin/python/samba' - print "Running: %s" % cmd + print("Running: %s" % cmd) os.system(cmd) def wafdocs(ctx): @@ -120,10 +120,10 @@ def wafdocs(ctx): list = recursive_dirlist('../buildtools/wafsamba', '.', pattern='*.py') cmd='LD_LIBRARY_PATH=bin/shared PYTHONPATH=bin/python pydoctor --project-name=wafsamba --project-url=http://www.samba.org --make-html --docformat=restructuredtext' - print list + print(list) for f in list: cmd += ' --add-module %s' % f - print "Running: %s" % cmd + print("Running: %s" % cmd) os.system(cmd) |