1 From 6488a68ca715d8e18f899e536effceb548ed136e Mon Sep 17 00:00:00 2001
2 From: =?utf-8?q?Ga=C3=ABl=20PORTAY?= <gael.portay@savoirfairelinux.com>
3 Date: Fri, 4 Nov 2016 12:23:25 -0400
4 Subject: [PATCH 2/3] Fix missing parentheses at print
6 Content-Type: text/plain; charset=utf-8
7 Content-Transfer-Encoding: 8bit
9 CC="cc -pipe -std=gnu99 -Wall -W -Wextra -fPIC -D_LARGEFILE64_SOURCE -D_ATFILE_SOURCE -DPSEUDO_PREFIX='"/usr/local"' -DPSEUDO_SUFFIX='""' -DPSEUDO_BINDIR='"bin"' -DPSEUDO_LIBDIR='"lib64"' -DPSEUDO_LOCALSTATEDIR='"var/pseudo"' -DPSEUDO_VERSION='"1.8.1"' -DUSE_MEMORY_DB -DPSEUDO_PASSWD_FALLBACK='""' -DPSEUDO_XATTR_SUPPORT -O2 -g " ./makewrappers "xattr=true"
10 File "./makewrappers", line 459
13 SyntaxError: Missing parentheses in call to 'print'
15 Signed-off-by: Gaƫl PORTAY <gael.portay@savoirfairelinux.com>
17 maketables | 12 ++++++------
18 makewrappers | 32 ++++++++++++++++----------------
19 templatefile.py | 8 ++++----
20 3 files changed, 26 insertions(+), 26 deletions(-)
22 diff --git a/maketables b/maketables
23 index b32312e..0726485 100755
26 @@ -73,7 +73,7 @@ class DataType:
29 if col.startswith("FLAGS"):
30 - print "Flags: set for %s" % self.name
31 + print("Flags: set for %s" % self.name)
34 if col.startswith("INDEXED "):
35 @@ -248,7 +248,7 @@ def main():
36 template_file.emit('header')
37 templates.append(template_file)
39 - print "Invalid or malformed template %s. Aborting." % path
40 + print("Invalid or malformed template %s. Aborting." % path)
43 for filename in sys.argv[1:]:
44 @@ -256,15 +256,15 @@ def main():
45 sys.stdout.write("%s: " % filename)
46 datatype = DataType(filename)
47 datatypes.append(datatype)
48 - print datatype.__repr__()
50 + print(datatype.__repr__())
53 - print "Writing datatypes...",
54 + print("Writing datatypes...")
55 for datatype in datatypes:
56 # populate various tables and files with each datatype
57 for template_file in templates:
58 template_file.emit('body', datatype)
59 - print "done. Cleaning up."
60 + print("done. Cleaning up.")
62 for template_file in templates:
64 diff --git a/makewrappers b/makewrappers
65 index 303e2cc..bac856b 100755
68 @@ -456,7 +456,7 @@ additional ports to include.
75 if os.path.exists(self.portfile("pseudo_wrappers.c")):
76 self.wrappers = self.portfile("pseudo_wrappers.c")
77 @@ -504,17 +504,17 @@ additional ports to include.
78 prefuncs = pre.functions()
79 for name in prefuncs.keys():
80 if name in mergedfuncs:
81 - print "Warning: %s from %s overriding %s" % (name, pre.name, mergedfuncs[name].port)
82 + print("Warning: %s from %s overriding %s" % (name, pre.name, mergedfuncs[name].port))
83 mergedfuncs[name] = prefuncs[name]
84 for name in self.funcs.keys():
85 if name in mergedfuncs:
86 - print "Warning: %s from %s overriding %s" % (name, self.name, mergedfuncs[name].port)
87 + print("Warning: %s from %s overriding %s" % (name, self.name, mergedfuncs[name].port))
88 mergedfuncs[name] = self.funcs[name]
89 for sub in self.subports:
90 subfuncs = sub.functions()
91 for name in subfuncs.keys():
92 if name in mergedfuncs:
93 - print "Warning: %s from %s overriding %s" % (name, sub.name, mergedfuncs[name].port)
94 + print("Warning: %s from %s overriding %s" % (name, sub.name, mergedfuncs[name].port))
95 mergedfuncs[name] = subfuncs[name]
98 @@ -576,11 +576,11 @@ def process_wrapfuncs(port):
99 func.directory = directory
100 funcs[func.name] = func
101 sys.stdout.write(".")
102 - except Exception, e:
103 - print "Parsing failed:", e
104 + except Exception(e):
105 + print("Parsing failed:", e)
113 @@ -599,35 +599,35 @@ def main(argv):
115 for path in glob.glob('templates/*'):
117 - print "Considering template: " + path
118 + print("Considering template: " + path)
119 source = TemplateFile(path)
120 if source.name.endswith('.c') or source.name.endswith('.h'):
121 source.emit('copyright')
122 source.emit('header')
123 sources.append(source)
125 - print "Invalid or malformed template %s. Aborting." % path
126 + print("Invalid or malformed template %s. Aborting." % path)
130 port = Port('common', sources)
133 - print "Unknown uname -s result: '%s'." % uname_s
134 - print "Known system types are:"
135 - print "%-20s %-10s %s" % ("uname -s", "port name", "description")
136 + print("Unknown uname -s result: '%s'." % uname_s)
137 + print("Known system types are:")
138 + print("%-20s %-10s %s" % ("uname -s", "port name", "description"))
139 for key in host_ports:
140 - print "%-20s %-10s %s" % (key, host_ports[key],
141 - host_descrs[host_ports[key]])
142 + print("%-20s %-10s %s" % (key, host_ports[key],
143 + host_descrs[host_ports[key]]))
145 # the per-function stuff
146 - print "Writing functions...",
147 + print("Writing functions...")
148 all_funcs = port.functions()
149 for name in sorted(all_funcs.keys()):
150 # populate various tables and files with each function
151 for source in sources:
152 source.emit('body', all_funcs[name])
153 - print "done. Cleaning up."
154 + print("done. Cleaning up.")
156 for source in sources:
158 diff --git a/templatefile.py b/templatefile.py
159 index 2789b22..abf9a2c 100644
160 --- a/templatefile.py
161 +++ b/templatefile.py
162 @@ -79,13 +79,13 @@ class TemplateFile:
164 path = Template(self.path).safe_substitute(item)
165 if os.path.exists(path):
166 - # print "We don't overwrite existing files."
167 + # print("We don't overwrite existing files.")
169 self.file = open(path, 'w')
171 - print "Couldn't open '%s' (expanded from %s), " \
172 + print("Couldn't open '%s' (expanded from %s), " \
173 "not emitting '%s'." % \
174 - (path, self.path, template)
175 + (path, self.path, template))
178 def emit(self, template, item=None):
179 @@ -103,7 +103,7 @@ class TemplateFile:
180 self.file.write(templ.safe_substitute(item))
181 self.file.write("\n")
183 - print "Warning: Unknown template '%s'." % template
184 + print("Warning: Unknown template '%s'." % template)
186 if self.file_per_item: