summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-10-06 20:11:01 +1100
committerAndrew Tridgell <tridge@samba.org>2010-10-06 11:13:05 +0000
commitc24240bcd2f833321f45ea4ce0b6c6d080a3b990 (patch)
tree0075709dd705752b56ee242bd01a72092c6a22c9
parent8fcccae6aa4f48e7ef03fbf8e5b5f24ea0209d2e (diff)
downloadsamba-c24240bcd2f833321f45ea4ce0b6c6d080a3b990.tar.gz
samba-c24240bcd2f833321f45ea4ce0b6c6d080a3b990.tar.bz2
samba-c24240bcd2f833321f45ea4ce0b6c6d080a3b990.zip
waf: fixed some python3.x portability issues
these have crept into the tree over time. Maybe we should add testing of a range of python versions to autobuild?
-rw-r--r--buildtools/wafsamba/samba_install.py2
-rw-r--r--buildtools/wafsamba/samba_utils.py4
-rw-r--r--buildtools/wafsamba/samba_version.py2
-rw-r--r--buildtools/wafsamba/wafsamba.py6
-rw-r--r--pidl/wscript3
-rw-r--r--source4/scripting/wscript_build7
-rw-r--r--source4/setup/wscript_build4
7 files changed, 18 insertions, 10 deletions
diff --git a/buildtools/wafsamba/samba_install.py b/buildtools/wafsamba/samba_install.py
index 05ea56cc47..dda44cd012 100644
--- a/buildtools/wafsamba/samba_install.py
+++ b/buildtools/wafsamba/samba_install.py
@@ -41,7 +41,7 @@ def install_binary(self):
# tell waf to install the right binary
bld.install_as(os.path.join(install_path, orig_target),
os.path.join(self.path.abspath(bld.env), self.target),
- chmod=0755)
+ chmod=MODE_755)
diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py
index d466cfaada..7ce9f757e9 100644
--- a/buildtools/wafsamba/samba_utils.py
+++ b/buildtools/wafsamba/samba_utils.py
@@ -11,6 +11,10 @@ import shlex
LIB_PATH="shared"
+# sigh, python octal constants are a mess
+MODE_644 = int('644', 8)
+MODE_755 = int('755', 8)
+
@conf
def SET_TARGET_TYPE(ctx, target, value):
'''set the target type of a target'''
diff --git a/buildtools/wafsamba/samba_version.py b/buildtools/wafsamba/samba_version.py
index 82f882f646..735a70002d 100644
--- a/buildtools/wafsamba/samba_version.py
+++ b/buildtools/wafsamba/samba_version.py
@@ -173,7 +173,7 @@ class samba_version_file(samba_version):
value = split_line[1].strip('"')
version_dict[split_line[0]] = value
except:
- print "Failed to parse line %s from %s" % (line, version_file)
+ print("Failed to parse line %s from %s" % (line, version_file))
raise
super(samba_version_file, self).__init__(version_dict, have_git=have_git)
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index da046e17a0..262d3bdc98 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -573,7 +573,7 @@ def SAMBA_SCRIPT(bld, name, pattern, installdir, installname=None):
Build.BuildContext.SAMBA_SCRIPT = SAMBA_SCRIPT
-def install_file(bld, destdir, file, chmod=0644, flat=False,
+def install_file(bld, destdir, file, chmod=MODE_644, flat=False,
python_fixup=False, destname=None, base_name=None):
'''install a file'''
destdir = bld.EXPAND_VARIABLES(destdir)
@@ -601,7 +601,7 @@ def install_file(bld, destdir, file, chmod=0644, flat=False,
bld.install_as(dest, file, chmod=chmod)
-def INSTALL_FILES(bld, destdir, files, chmod=0644, flat=False,
+def INSTALL_FILES(bld, destdir, files, chmod=MODE_644, flat=False,
python_fixup=False, destname=None, base_name=None):
'''install a set of files'''
for f in TO_LIST(files):
@@ -611,7 +611,7 @@ def INSTALL_FILES(bld, destdir, files, chmod=0644, flat=False,
Build.BuildContext.INSTALL_FILES = INSTALL_FILES
-def INSTALL_WILDCARD(bld, destdir, pattern, chmod=0644, flat=False,
+def INSTALL_WILDCARD(bld, destdir, pattern, chmod=MODE_644, flat=False,
python_fixup=False, exclude=None, trim_path=None):
'''install a set of files matching a wildcard pattern'''
files=TO_LIST(bld.path.ant_glob(pattern))
diff --git a/pidl/wscript b/pidl/wscript
index f2b65c864b..8cb0c6f5b3 100644
--- a/pidl/wscript
+++ b/pidl/wscript
@@ -1,6 +1,7 @@
#!/usr/bin/env python
import os
+from samba_utils import MODE_755
def set_options(opt):
opt.tool_options('perl')
@@ -18,7 +19,7 @@ def configure(conf):
conf.find_program('pod2man', var='POD2MAN')
def build(bld):
- bld.INSTALL_FILES('${BINDIR}', 'pidl', chmod=0755)
+ bld.INSTALL_FILES('${BINDIR}', 'pidl', chmod=MODE_755)
bld.RECURSE('lib')
diff --git a/source4/scripting/wscript_build b/source4/scripting/wscript_build
index 8d1b168135..76ff739c9e 100644
--- a/source4/scripting/wscript_build
+++ b/source4/scripting/wscript_build
@@ -1,7 +1,8 @@
#!/usr/bin/env python
+from samba_utils import MODE_755
+
bld.INSTALL_FILES('${SBINDIR}','bin/upgradeprovision bin/samba_dnsupdate bin/samba_spnupdate',
- chmod=0755, python_fixup=True, flat=True)
+ chmod=MODE_755, python_fixup=True, flat=True)
bld.INSTALL_FILES('${BINDIR}','bin/testparm',
- chmod=0755, python_fixup=True, flat=True)
-
+ chmod=MODE_755, python_fixup=True, flat=True)
diff --git a/source4/setup/wscript_build b/source4/setup/wscript_build
index f337e6f526..241e8b8686 100644
--- a/source4/setup/wscript_build
+++ b/source4/setup/wscript_build
@@ -1,9 +1,11 @@
#!/usr/bin/env python
+from samba_utils import MODE_755
+
bld.INSTALL_WILDCARD('${SETUPDIR}', 'ad-schema/*.txt')
bld.INSTALL_WILDCARD('${SETUPDIR}', 'display-specifiers/*.txt')
-bld.INSTALL_FILES('${SBINDIR}', 'provision', chmod=0755, python_fixup=True)
+bld.INSTALL_FILES('${SBINDIR}', 'provision', chmod=MODE_755, python_fixup=True)
bld.INSTALL_FILES('${SETUPDIR}', 'dns_update_list')
bld.INSTALL_FILES('${SETUPDIR}', 'spn_update_list')