author | John Beck <John.Beck@Oracle.COM> |
Wed, 16 Nov 2016 12:24:25 -0800 | |
changeset 7375 | b55580983599 |
permissions | -rw-r--r-- |
7375
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
1 |
Needed as a counterpart to Python's 64-bit patch. Will not be submitted |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
2 |
upstream. |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
3 |
|
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
4 |
--- setuptools-19.2/setuptools/command/bdist_egg.py.~1~ 2015-12-11 08:17:56.000000000 +0000 |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
5 |
+++ setuptools-19.2/setuptools/command/bdist_egg.py 2016-11-16 11:46:37.034754212 +0000 |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
6 |
@@ -167,11 +167,24 @@ |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
7 |
filename, ext = os.path.splitext(ext_name) |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
8 |
pyfile = os.path.join(self.bdist_dir, strip_module(filename) + |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
9 |
'.py') |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
10 |
- self.stubs.append(pyfile) |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
11 |
+ dirname, basename = os.path.split(pyfile) |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
12 |
+ dirnamehead, dirnametail = os.path.split(dirname) |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
13 |
+ # Strip any trailing '64' dirs in the .py file path. |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
14 |
+ if dirnametail == '64': |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
15 |
+ tweakedpyfile = os.path.join(dirnamehead, basename) |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
16 |
+ else: |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
17 |
+ tweakedpyfile = pyfile |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
18 |
+ self.stubs.append(tweakedpyfile) |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
19 |
log.info("creating stub loader for %s" % ext_name) |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
20 |
if not self.dry_run: |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
21 |
- write_stub(os.path.basename(ext_name), pyfile) |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
22 |
- to_compile.append(pyfile) |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
23 |
+ # If pyfile is unchanged, then the .so should be in the same |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
24 |
+ # directory, but if we tweaked it, then we need to add back |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
25 |
+ # the '64' that we had stripped. |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
26 |
+ resource = os.path.basename(ext_name) |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
27 |
+ if pyfile != tweakedpyfile: |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
28 |
+ resource = os.path.join('64', resource) |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
29 |
+ write_stub(resource, tweakedpyfile) |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
30 |
+ to_compile.append(tweakedpyfile) |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
31 |
ext_outputs[p] = ext_name.replace(os.sep, '/') |
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
32 |
|
b55580983599
25107269 setuptools' bdist_egg needs to adjust for Python 2.7's 64-bit .so paths
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
33 |
if to_compile: |