[Python-checkins] CVS: distutils/distutils/command install.py,1.32,1.33
Greg Ward
python-dev@python.org
Fri, 26 May 2000 18:33:15 -0700
Update of /cvsroot/python/distutils/distutils/command
In directory slayer.i.sourceforge.net:/tmp/cvs-serv11767
Modified Files:
install.py
Log Message:
Support for the "install_headers" command:
* 'headers' entry added to all the install schemes
* '--install-headers' option added
* 'install_headers' added to 'sub_commands'
* added 'dist_name' to configuration variables (along with a few
others that seem handy: 'dist_version', 'dist_fullname', and
'py_version'
* in 'finalize_unix()', make sure 'install_headers' defined if
user specified 'install_base' and/or 'install_platbase'
* added 'has_headers()'
* a few other small changes
Index: install.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/command/install.py,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -r1.32 -r1.33
*** install.py 2000/05/25 01:10:04 1.32
--- install.py 2000/05/27 01:33:12 1.33
***************
*** 5,9 ****
# created 1999/03/13, Greg Ward
! __revision__ = "$Id: install.py,v 1.32 2000/05/25 01:10:04 gward Exp $"
import sys, os, string
--- 5,9 ----
# created 1999/03/13, Greg Ward
! __revision__ = "$Id: install.py,v 1.33 2000/05/27 01:33:12 gward Exp $"
import sys, os, string
***************
*** 19,22 ****
--- 19,23 ----
'purelib': '$base/lib/python$py_version_short/site-packages',
'platlib': '$platbase/lib/python$py_version_short/site-packages',
+ 'headers': '$base/include/python/$py_version_short/$dist_name',
'scripts': '$base/bin',
'data' : '$base/share',
***************
*** 25,28 ****
--- 26,30 ----
'purelib': '$base/lib/python',
'platlib': '$base/lib/python',
+ 'headers': '$base/include/python/$dist_name',
'scripts': '$base/bin',
'data' : '$base/share',
***************
*** 31,34 ****
--- 33,37 ----
'purelib': '$base',
'platlib': '$base',
+ 'headers': '$base\\Include\\$dist_name',
'scripts': '$base\\Scripts',
'data' : '$base\\Data',
***************
*** 37,40 ****
--- 40,44 ----
'purelib': '$base:Lib',
'platlib': '$base:Mac:PlugIns',
+ 'headers': '$base:Include:$dist_name',
'scripts': '$base:Scripts',
'data' : '$base:Data',
***************
*** 74,77 ****
--- 78,83 ----
"(overrides --install-purelib and --install-platlib)"),
+ ('install-headers=', None,
+ "installation directory for C/C++ headers"),
('install-scripts=', None,
"installation directory for Python scripts"),
***************
*** 100,103 ****
--- 106,110 ----
# If 'method' is None, assume that 'command' must always be run.
sub_commands = [('has_lib', 'install_lib'),
+ ('has_headers', 'install_headers'),
('has_scripts', 'install_scripts'),
('has_data', 'install_data'),
***************
*** 126,129 ****
--- 133,137 ----
self.install_purelib = None # for pure module distributions
self.install_platlib = None # non-pure (dists w/ extensions)
+ self.install_headers = None # for C/C++ headers
self.install_lib = None # set to either purelib or platlib
self.install_scripts = None
***************
*** 201,205 ****
# INSTALL_SCHEME dictionary above. Phew!
! self.dump_dirs ("pre-finalize_xxx")
if os.name == 'posix':
--- 209,213 ----
# INSTALL_SCHEME dictionary above. Phew!
! self.dump_dirs ("pre-finalize_{unix,other}")
if os.name == 'posix':
***************
*** 208,212 ****
self.finalize_other ()
! self.dump_dirs ("post-finalize_xxx()")
# Expand configuration variables, tilde, etc. in self.install_base
--- 216,220 ----
self.finalize_other ()
! self.dump_dirs ("post-finalize_{unix,other}()")
# Expand configuration variables, tilde, etc. in self.install_base
***************
*** 215,219 ****
# about needing recursive variable expansion (shudder).
! self.config_vars = {'py_version_short': sys.version[0:3],
'sys_prefix': sysconfig.PREFIX,
'sys_exec_prefix': sysconfig.EXEC_PREFIX,
--- 223,232 ----
# about needing recursive variable expansion (shudder).
! py_version = (string.split(sys.version))[0]
! self.config_vars = {'dist_name': self.distribution.get_name(),
! 'dist_version': self.distribution.get_version(),
! 'dist_fullname': self.distribution.get_fullname(),
! 'py_version': py_version,
! 'py_version_short': py_version[0:3],
'sys_prefix': sysconfig.PREFIX,
'sys_exec_prefix': sysconfig.EXEC_PREFIX,
***************
*** 296,299 ****
--- 309,313 ----
self.install_purelib is None and
self.install_platlib is None) or
+ self.install_headers is None or
self.install_scripts is None or
self.install_data is None):
***************
*** 301,305 ****
"install-base or install-platbase supplied, but " + \
"installation scheme is incomplete"
-
return
--- 315,318 ----
***************
*** 360,364 ****
# it's the caller's problem if they supply a bad name!
scheme = INSTALL_SCHEMES[name]
! for key in ('purelib', 'platlib', 'scripts', 'data'):
attrname = 'install_' + key
if getattr(self, attrname) is None:
--- 373,377 ----
# it's the caller's problem if they supply a bad name!
scheme = INSTALL_SCHEMES[name]
! for key in ('purelib', 'platlib', 'headers', 'scripts', 'data'):
attrname = 'install_' + key
if getattr(self, attrname) is None:
***************
*** 385,388 ****
--- 398,402 ----
'install_platlib',
'install_lib',
+ 'install_headers',
'install_scripts',
'install_data',])
***************
*** 478,481 ****
--- 492,498 ----
return (self.distribution.has_pure_modules() or
self.distribution.has_ext_modules())
+
+ def has_headers (self):
+ return self.distribution.has_headers()
def has_scripts (self):