summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2019-02-06 17:26:34 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-02-08 10:57:19 +0000
commite2c3247c233876ab090c9ce3d5325a6d46ab350f (patch)
treecf38957a3510be612cde924f6184a5251b968a43 /meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch
parentcd6c61a26177296e24b442e2eda1514b5f931c0a (diff)
downloadpoky-e2c3247c233876ab090c9ce3d5325a6d46ab350f.tar.gz
python3: upgrade to 3.7.2
I took the same approach as the recent perl upgrade: write recipe from scratch, taking the pieces from the old recipe only when they were proven to be necessary. The pgo, manifest and ptest features are all preserved. New features: - native and target recipes are now unified into one recipe - check_build_completeness.py runs right after do_compile() and verifies that all optional modules have been built (a notorious source of regressions) - a new approach to sysconfig.py and distutils/sysconfig.py returning values appropriate for native or target builds: we copy the configuration file to a separate folder, add that folder to sys.path (through environment variable that differs between native and target builds), and point python to the file through another environment variable. There were a few other patches where it was difficult to decide if the patch is still relevant, and how to test that it works correctly; please add those as-needed by testing the new python. (From OE-Core rev: 02714c105426b0d687620913c1a7401b386428b6) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch')
-rw-r--r--meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch92
1 files changed, 0 insertions, 92 deletions
diff --git a/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch b/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch
deleted file mode 100644
index b96419a638..0000000000
--- a/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch
+++ /dev/null
@@ -1,92 +0,0 @@
1do not "adjust" python files before copying
2
3-Khem
4
5Upstream-Status: Inappropriate [Embedded-Specific]
6
7---
8 Lib/distutils/command/build_scripts.py | 43 +++------------------------------
9 1 file changed, 4 insertions(+), 39 deletions(-)
10
11--- a/Lib/distutils/command/build_scripts.py
12+++ b/Lib/distutils/command/build_scripts.py
13@@ -51,10 +51,7 @@ class build_scripts(Command):
14
15
16 def copy_scripts(self):
17- """Copy each script listed in 'self.scripts'; if it's marked as a
18- Python script in the Unix way (first line matches 'first_line_re',
19- ie. starts with "\#!" and contains "python"), then adjust the first
20- line to refer to the current Python interpreter as we copy.
21+ """Copy each script listed in 'self.scripts'
22 """
23 self.mkpath(self.build_dir)
24 outfiles = []
25@@ -78,64 +75,10 @@ class build_scripts(Command):
26 if not self.dry_run:
27 raise
28 f = None
29- else:
30- encoding, lines = tokenize.detect_encoding(f.readline)
31- f.seek(0)
32- first_line = f.readline()
33- if not first_line:
34- self.warn("%s is an empty file (skipping)" % script)
35- continue
36-
37- match = first_line_re.match(first_line)
38- if match:
39- adjust = True
40- post_interp = match.group(1) or b''
41-
42- if adjust:
43- log.info("copying and adjusting %s -> %s", script,
44- self.build_dir)
45- updated_files.append(outfile)
46- if not self.dry_run:
47- if not sysconfig.python_build:
48- executable = self.executable
49- else:
50- executable = os.path.join(
51- sysconfig.get_config_var("BINDIR"),
52- "python%s%s" % (sysconfig.get_config_var("VERSION"),
53- sysconfig.get_config_var("EXE")))
54- executable = os.fsencode(executable)
55- shebang = b"#!" + executable + post_interp + b"\n"
56- # Python parser starts to read a script using UTF-8 until
57- # it gets a #coding:xxx cookie. The shebang has to be the
58- # first line of a file, the #coding:xxx cookie cannot be
59- # written before. So the shebang has to be decodable from
60- # UTF-8.
61- try:
62- shebang.decode('utf-8')
63- except UnicodeDecodeError:
64- raise ValueError(
65- "The shebang ({!r}) is not decodable "
66- "from utf-8".format(shebang))
67- # If the script is encoded to a custom encoding (use a
68- # #coding:xxx cookie), the shebang has to be decodable from
69- # the script encoding too.
70- try:
71- shebang.decode(encoding)
72- except UnicodeDecodeError:
73- raise ValueError(
74- "The shebang ({!r}) is not decodable "
75- "from the script encoding ({})"
76- .format(shebang, encoding))
77- with open(outfile, "wb") as outf:
78- outf.write(shebang)
79- outf.writelines(f.readlines())
80- if f:
81- f.close()
82- else:
83- if f:
84+ if f:
85 f.close()
86- updated_files.append(outfile)
87- self.copy_file(script, outfile)
88+ updated_files.append(outfile)
89+ self.copy_file(script, outfile)
90
91 if os.name == 'posix':
92 for file in outfiles: