0002-Fix-missing-parentheses-at-print.patch 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=utf-8
  7. Content-Transfer-Encoding: 8bit
  8. 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"
  9. File "./makewrappers", line 459
  10. print port
  11. ^
  12. SyntaxError: Missing parentheses in call to 'print'
  13. Signed-off-by: Gaël PORTAY <gael.portay@savoirfairelinux.com>
  14. ---
  15. maketables | 12 ++++++------
  16. makewrappers | 32 ++++++++++++++++----------------
  17. templatefile.py | 8 ++++----
  18. 3 files changed, 26 insertions(+), 26 deletions(-)
  19. diff --git a/maketables b/maketables
  20. index b32312e..0726485 100755
  21. --- a/maketables
  22. +++ b/maketables
  23. @@ -73,7 +73,7 @@ class DataType:
  24. for col in columns:
  25. indexed = False
  26. if col.startswith("FLAGS"):
  27. - print "Flags: set for %s" % self.name
  28. + print("Flags: set for %s" % self.name)
  29. self.flags = True
  30. continue
  31. if col.startswith("INDEXED "):
  32. @@ -248,7 +248,7 @@ def main():
  33. template_file.emit('header')
  34. templates.append(template_file)
  35. except IOError:
  36. - print "Invalid or malformed template %s. Aborting." % path
  37. + print("Invalid or malformed template %s. Aborting." % path)
  38. exit(1)
  39. for filename in sys.argv[1:]:
  40. @@ -256,15 +256,15 @@ def main():
  41. sys.stdout.write("%s: " % filename)
  42. datatype = DataType(filename)
  43. datatypes.append(datatype)
  44. - print datatype.__repr__()
  45. - print ""
  46. + print(datatype.__repr__())
  47. + print("")
  48. - print "Writing datatypes...",
  49. + print("Writing datatypes...")
  50. for datatype in datatypes:
  51. # populate various tables and files with each datatype
  52. for template_file in templates:
  53. template_file.emit('body', datatype)
  54. - print "done. Cleaning up."
  55. + print("done. Cleaning up.")
  56. for template_file in templates:
  57. # clean up files
  58. diff --git a/makewrappers b/makewrappers
  59. index 303e2cc..bac856b 100755
  60. --- a/makewrappers
  61. +++ b/makewrappers
  62. @@ -456,7 +456,7 @@ additional ports to include.
  63. self.name = port
  64. self.subports = []
  65. self.preports = []
  66. - print port
  67. + print(port)
  68. if os.path.exists(self.portfile("pseudo_wrappers.c")):
  69. self.wrappers = self.portfile("pseudo_wrappers.c")
  70. @@ -504,17 +504,17 @@ additional ports to include.
  71. prefuncs = pre.functions()
  72. for name in prefuncs.keys():
  73. if name in mergedfuncs:
  74. - print "Warning: %s from %s overriding %s" % (name, pre.name, mergedfuncs[name].port)
  75. + print("Warning: %s from %s overriding %s" % (name, pre.name, mergedfuncs[name].port))
  76. mergedfuncs[name] = prefuncs[name]
  77. for name in self.funcs.keys():
  78. if name in mergedfuncs:
  79. - print "Warning: %s from %s overriding %s" % (name, self.name, mergedfuncs[name].port)
  80. + print("Warning: %s from %s overriding %s" % (name, self.name, mergedfuncs[name].port))
  81. mergedfuncs[name] = self.funcs[name]
  82. for sub in self.subports:
  83. subfuncs = sub.functions()
  84. for name in subfuncs.keys():
  85. if name in mergedfuncs:
  86. - print "Warning: %s from %s overriding %s" % (name, sub.name, mergedfuncs[name].port)
  87. + print("Warning: %s from %s overriding %s" % (name, sub.name, mergedfuncs[name].port))
  88. mergedfuncs[name] = subfuncs[name]
  89. return mergedfuncs
  90. @@ -576,11 +576,11 @@ def process_wrapfuncs(port):
  91. func.directory = directory
  92. funcs[func.name] = func
  93. sys.stdout.write(".")
  94. - except Exception, e:
  95. - print "Parsing failed:", e
  96. + except Exception(e):
  97. + print("Parsing failed:", e)
  98. exit(1)
  99. funclist.close()
  100. - print ""
  101. + print("")
  102. return funcs
  103. def main(argv):
  104. @@ -599,35 +599,35 @@ def main(argv):
  105. for path in glob.glob('templates/*'):
  106. try:
  107. - print "Considering template: " + path
  108. + print("Considering template: " + path)
  109. source = TemplateFile(path)
  110. if source.name.endswith('.c') or source.name.endswith('.h'):
  111. source.emit('copyright')
  112. source.emit('header')
  113. sources.append(source)
  114. except IOError:
  115. - print "Invalid or malformed template %s. Aborting." % path
  116. + print("Invalid or malformed template %s. Aborting." % path)
  117. exit(1)
  118. try:
  119. port = Port('common', sources)
  120. except KeyError:
  121. - print "Unknown uname -s result: '%s'." % uname_s
  122. - print "Known system types are:"
  123. - print "%-20s %-10s %s" % ("uname -s", "port name", "description")
  124. + print("Unknown uname -s result: '%s'." % uname_s)
  125. + print("Known system types are:")
  126. + print("%-20s %-10s %s" % ("uname -s", "port name", "description"))
  127. for key in host_ports:
  128. - print "%-20s %-10s %s" % (key, host_ports[key],
  129. - host_descrs[host_ports[key]])
  130. + print("%-20s %-10s %s" % (key, host_ports[key],
  131. + host_descrs[host_ports[key]]))
  132. # the per-function stuff
  133. - print "Writing functions...",
  134. + print("Writing functions...")
  135. all_funcs = port.functions()
  136. for name in sorted(all_funcs.keys()):
  137. # populate various tables and files with each function
  138. for source in sources:
  139. source.emit('body', all_funcs[name])
  140. - print "done. Cleaning up."
  141. + print("done. Cleaning up.")
  142. for source in sources:
  143. # clean up files
  144. diff --git a/templatefile.py b/templatefile.py
  145. index 2789b22..abf9a2c 100644
  146. --- a/templatefile.py
  147. +++ b/templatefile.py
  148. @@ -79,13 +79,13 @@ class TemplateFile:
  149. return
  150. path = Template(self.path).safe_substitute(item)
  151. if os.path.exists(path):
  152. - # print "We don't overwrite existing files."
  153. + # print("We don't overwrite existing files.")
  154. return
  155. self.file = open(path, 'w')
  156. if not self.file:
  157. - print "Couldn't open '%s' (expanded from %s), " \
  158. + print("Couldn't open '%s' (expanded from %s), " \
  159. "not emitting '%s'." % \
  160. - (path, self.path, template)
  161. + (path, self.path, template))
  162. return
  163. def emit(self, template, item=None):
  164. @@ -103,7 +103,7 @@ class TemplateFile:
  165. self.file.write(templ.safe_substitute(item))
  166. self.file.write("\n")
  167. else:
  168. - print "Warning: Unknown template '%s'." % template
  169. + print("Warning: Unknown template '%s'." % template)
  170. if self.file_per_item:
  171. if self.file:
  172. --
  173. 2.10.1