summaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2018-12-12 10:54:47 +1300
committerAndrew Bartlett <abartlet@samba.org>2018-12-13 01:49:30 +0100
commitc71417a0ebf563f649e1a8fdc599b33cd33e62dd (patch)
tree2423b5294a7ac83a3276ef1e9ce94626d675a874 /buildtools
parent9c507e98f03eabe59df774a9a5f51411fc23d4e5 (diff)
downloadsamba-c71417a0ebf563f649e1a8fdc599b33cd33e62dd.tar.gz
waf-py3: Allow waf build --dup-symbol-check to operate in python3
Use the b prefix on output from subcommands to match bytes with bytes. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <npower@samba.org>
Diffstat (limited to 'buildtools')
-rw-r--r--buildtools/wafsamba/symbols.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/buildtools/wafsamba/symbols.py b/buildtools/wafsamba/symbols.py
index 502407c60c6..4eab8e4a059 100644
--- a/buildtools/wafsamba/symbols.py
+++ b/buildtools/wafsamba/symbols.py
@@ -59,12 +59,12 @@ def symbols_extract(bld, objfiles, dynamic=False):
for line in nmpipe:
line = line.strip()
- if line.endswith(':'):
+ if line.endswith(b':'):
filename = line[:-1]
ret[filename] = { "PUBLIC": set(), "UNDEFINED" : set() }
continue
- cols = line.split(" ")
- if cols == ['']:
+ cols = line.split(b" ")
+ if cols == [b'']:
continue
# see if the line starts with an address
if len(cols) == 3:
@@ -73,10 +73,10 @@ def symbols_extract(bld, objfiles, dynamic=False):
else:
symbol_type = cols[0]
symbol = cols[1]
- if symbol_type in "BDGTRVWSi":
+ if symbol_type in b"BDGTRVWSi":
# its a public symbol
ret[filename]["PUBLIC"].add(symbol)
- elif symbol_type in "U":
+ elif symbol_type in b"U":
ret[filename]["UNDEFINED"].add(symbol)
# add to the cache
@@ -106,10 +106,10 @@ def find_ldd_path(bld, libname, binary):
lddpipe = subprocess.Popen(['ldd', binary], stdout=subprocess.PIPE).stdout
for line in lddpipe:
line = line.strip()
- cols = line.split(" ")
- if len(cols) < 3 or cols[1] != "=>":
+ cols = line.split(b" ")
+ if len(cols) < 3 or cols[1] != b"=>":
continue
- if cols[0].startswith("libc."):
+ if cols[0].startswith(b"libc."):
# save this one too
bld.env.libc_path = cols[2]
if cols[0].startswith(libname):
@@ -119,8 +119,8 @@ def find_ldd_path(bld, libname, binary):
# some regular expressions for parsing readelf output
-re_sharedlib = re.compile('Shared library: \[(.*)\]')
-re_rpath = re.compile('Library rpath: \[(.*)\]')
+re_sharedlib = re.compile(b'Shared library: \[(.*)\]')
+re_rpath = re.compile(b'Library rpath: \[(.*)\]')
def get_libs(bld, binname):
'''find the list of linked libraries for any binary or library