diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2006-12-10 00:35:20 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2006-12-10 00:35:20 (GMT) |
commit | a7ce71b5e9c62ad8099858832101590053afcaca (patch) | |
tree | e67503099be6020d3cdec169bf8c1489f23ba2d3 | |
parent | 885fe063530334dcd21c4ba10f4ae5de75c11bd6 (diff) | |
download | cpython-a7ce71b5e9c62ad8099858832101590053afcaca.zip cpython-a7ce71b5e9c62ad8099858832101590053afcaca.tar.gz cpython-a7ce71b5e9c62ad8099858832101590053afcaca.tar.bz2 |
[Jython patch #1578658] Make distutils work for Jython, at least for
pure-Python distributions.
Patch by Supreet Sethi, slightly modified by adding the change
to sysconfig.py.
-rw-r--r-- | Lib/distutils/command/install.py | 9 | ||||
-rw-r--r-- | Lib/distutils/dist.py | 3 | ||||
-rw-r--r-- | Lib/distutils/sysconfig.py | 5 |
3 files changed, 15 insertions, 2 deletions
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py index 2f8cc33..363a939 100644 --- a/Lib/distutils/command/install.py +++ b/Lib/distutils/command/install.py @@ -55,7 +55,14 @@ INSTALL_SCHEMES = { 'headers': '$base/Include/$dist_name', 'scripts': '$base/Scripts', 'data' : '$base', - } + }, + 'java': { + 'purelib': '$base/Lib', + 'platlib': '$base/Lib', + 'headers': '$base/Include/$dist_name', + 'scripts': '$base/Scripts', + 'data' : '$base', + }, } # The keys to an installation scheme; if any new types of files are to be diff --git a/Lib/distutils/dist.py b/Lib/distutils/dist.py index 8a10fc5..576f6ed 100644 --- a/Lib/distutils/dist.py +++ b/Lib/distutils/dist.py @@ -130,7 +130,8 @@ class Distribution: self.metadata = DistributionMetadata() for basename in self.metadata._METHOD_BASENAMES: method_name = "get_" + basename - setattr(self, method_name, getattr(self.metadata, method_name)) + if hasattr(self.metadata, method_name): + setattr(self, method_name, getattr(self.metadata, method_name)) # 'cmdclass' maps command names to class objects, so we # can 1) quickly figure out which class to instantiate when diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py index 7c16d51..c72913a 100644 --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py @@ -119,6 +119,11 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): return os.path.join(prefix, "Lib") else: return os.path.join(prefix, "Lib", "site-packages") + elif os.name == "java": + if standard_lib: + return os.path.join(prefix, "Lib") + else: + return os.path.join(prefix, "Lib", "site-packages") else: raise DistutilsPlatformError( "I don't know where Python installs its library " |