[Python-checkins] CVS: distutils/distutils/command bdist.py,1.18,1.19 bdist_dumb.py,1.15,1.16 bdist_rpm.py,1.22,1.23 bdist_wininst.py,1.16,1.17 build.py,1.29,1.30 build_clib.py,1.20,1.21 build_ext.py,1.67,1.68 build_py.py,1.31,1.32 build_scripts.py,1.5,1.6 clean.py,1.10,1.11 config.py,1.3,1.4 install.py,1.49,1.50 install_scripts.py,1.9,1.10 sdist.py,1.49,1.50
Greg Ward
python-dev@python.org
Sat, 30 Sep 2000 11:27:58 -0700
Update of /cvsroot/python/distutils/distutils/command
In directory slayer.i.sourceforge.net:/tmp/cvs-serv29622
Modified Files:
bdist.py bdist_dumb.py bdist_rpm.py bdist_wininst.py build.py
build_clib.py build_ext.py build_py.py build_scripts.py
clean.py config.py install.py install_scripts.py sdist.py
Log Message:
Standardized whitespace around function calls.
Index: bdist.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/command/bdist.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** bdist.py 2000/09/16 16:04:59 1.18
--- bdist.py 2000/09/30 18:27:54 1.19
***************
*** 133,137 ****
if cmd_name in commands[i+1:]:
sub_cmd.keep_temp = 1
! self.run_command (cmd_name)
# run()
--- 133,137 ----
if cmd_name in commands[i+1:]:
sub_cmd.keep_temp = 1
! self.run_command(cmd_name)
# run()
Index: bdist_dumb.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/command/bdist_dumb.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** bdist_dumb.py 2000/09/25 01:41:12 1.15
--- bdist_dumb.py 2000/09/30 18:27:54 1.16
***************
*** 72,81 ****
def run (self):
! self.run_command ('build')
install = self.reinitialize_command('install', reinit_subcommands=1)
install.root = self.bdist_dir
! self.announce ("installing to %s" % self.bdist_dir)
self.run_command('install')
--- 72,81 ----
def run (self):
! self.run_command('build')
install = self.reinitialize_command('install', reinit_subcommands=1)
install.root = self.bdist_dir
! self.announce("installing to %s" % self.bdist_dir)
self.run_command('install')
***************
*** 84,93 ****
archive_basename = "%s.%s" % (self.distribution.get_fullname(),
self.plat_name)
! self.make_archive (os.path.join(self.dist_dir, archive_basename),
! self.format,
! root_dir=self.bdist_dir)
if not self.keep_temp:
! remove_tree (self.bdist_dir, self.verbose, self.dry_run)
# run()
--- 84,93 ----
archive_basename = "%s.%s" % (self.distribution.get_fullname(),
self.plat_name)
! self.make_archive(os.path.join(self.dist_dir, archive_basename),
! self.format,
! root_dir=self.bdist_dir)
if not self.keep_temp:
! remove_tree(self.bdist_dir, self.verbose, self.dry_run)
# run()
Index: bdist_rpm.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/command/bdist_rpm.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** bdist_rpm.py 2000/09/25 01:53:01 1.22
--- bdist_rpm.py 2000/09/30 18:27:54 1.23
***************
*** 259,263 ****
# Make a source distribution and copy to SOURCES directory with
# optional icon.
! sdist = self.reinitialize_command ('sdist')
if self.use_bzip2:
sdist.formats = ['bztar']
--- 259,263 ----
# Make a source distribution and copy to SOURCES directory with
# optional icon.
! sdist = self.reinitialize_command('sdist')
if self.use_bzip2:
sdist.formats = ['bztar']
Index: bdist_wininst.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/command/bdist_wininst.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** bdist_wininst.py 2000/09/29 11:36:55 1.16
--- bdist_wininst.py 2000/09/30 18:27:54 1.17
***************
*** 57,62 ****
short_version = sys.version[:3]
if self.target_version and self.target_version != short_version:
! raise DistutilsOptionError ("target version can only be" +
! short_version)
self.target_version = short_version
--- 57,62 ----
short_version = sys.version[:3]
if self.target_version and self.target_version != short_version:
! raise DistutilsOptionError, \
! "target version can only be" + short_version
self.target_version = short_version
***************
*** 74,78 ****
"must be compiled on a Windows 32 platform")
! self.run_command ('build')
install = self.reinitialize_command('install')
--- 74,78 ----
"must be compiled on a Windows 32 platform")
! self.run_command('build')
install = self.reinitialize_command('install')
***************
*** 92,96 ****
install_lib.ensure_finalized()
! self.announce ("installing to %s" % self.bdist_dir)
install.ensure_finalized()
install.run()
--- 92,96 ----
install_lib.ensure_finalized()
! self.announce("installing to %s" % self.bdist_dir)
install.ensure_finalized()
install.run()
***************
*** 104,125 ****
# Our archive MUST be relative to sys.prefix, which is the
# same as install_purelib in the 'nt' scheme.
! root_dir = os.path.normpath (install.install_purelib)
# Sanity check: Make sure everything is included
for key in ('purelib', 'platlib', 'headers', 'scripts', 'data'):
attrname = 'install_' + key
! install_x = getattr (install, attrname)
# (Use normpath so that we can string.find to look for
# subdirectories)
! install_x = os.path.normpath (install_x)
! if string.find (install_x, root_dir) != 0:
raise DistutilsInternalError \
("'%s' not included in install_lib" % key)
! arcname = self.make_archive (archive_basename, "zip",
! root_dir=root_dir)
! self.create_exe (arcname, fullname)
if not self.keep_temp:
! remove_tree (self.bdist_dir, self.verbose, self.dry_run)
# run()
--- 104,125 ----
# Our archive MUST be relative to sys.prefix, which is the
# same as install_purelib in the 'nt' scheme.
! root_dir = os.path.normpath(install.install_purelib)
# Sanity check: Make sure everything is included
for key in ('purelib', 'platlib', 'headers', 'scripts', 'data'):
attrname = 'install_' + key
! install_x = getattr(install, attrname)
# (Use normpath so that we can string.find to look for
# subdirectories)
! install_x = os.path.normpath(install_x)
! if string.find(install_x, root_dir) != 0:
raise DistutilsInternalError \
("'%s' not included in install_lib" % key)
! arcname = self.make_archive(archive_basename, "zip",
! root_dir=root_dir)
! self.create_exe(arcname, fullname)
if not self.keep_temp:
! remove_tree(self.bdist_dir, self.verbose, self.dry_run)
# run()
***************
*** 134,138 ****
# repr()[1:-1], so they do not contain unprintable characters, and
# are not surrounded by quote chars.
! lines.append ("[metadata]")
# 'info' will be displayed in the installer's dialog box,
--- 134,138 ----
# repr()[1:-1], so they do not contain unprintable characters, and
# are not surrounded by quote chars.
! lines.append("[metadata]")
# 'info' will be displayed in the installer's dialog box,
***************
*** 140,168 ****
info = (metadata.long_description or '') + '\n'
! for name in dir (metadata):
if (name != 'long_description'):
! data = getattr (metadata, name)
if data:
info = info + ("\n %s: %s" % \
! (string.capitalize (name), data))
! lines.append ("%s=%s" % (name, repr (data)[1:-1]))
# The [setup] section contains entries controlling
# the installer runtime.
! lines.append ("\n[Setup]")
! lines.append ("info=%s" % repr (info)[1:-1])
! lines.append ("target_compile=%d" % (not self.no_target_compile))
! lines.append ("target_optimize=%d" % (not self.no_target_optimize))
if self.target_version:
! lines.append ("target_version=%s" % self.target_version)
title = self.distribution.get_fullname()
! lines.append ("title=%s" % repr (title)[1:-1])
import time
import distutils
build_info = "Build %s with distutils-%s" % \
! (time.ctime (time.time()), distutils.__version__)
! lines.append ("build_info=%s" % build_info)
! return string.join (lines, "\n")
# get_inidata()
--- 140,168 ----
info = (metadata.long_description or '') + '\n'
! for name in dir(metadata):
if (name != 'long_description'):
! data = getattr(metadata, name)
if data:
info = info + ("\n %s: %s" % \
! (string.capitalize(name), data))
! lines.append("%s=%s" % (name, repr(data)[1:-1]))
# The [setup] section contains entries controlling
# the installer runtime.
! lines.append("\n[Setup]")
! lines.append("info=%s" % repr(info)[1:-1])
! lines.append("target_compile=%d" % (not self.no_target_compile))
! lines.append("target_optimize=%d" % (not self.no_target_optimize))
if self.target_version:
! lines.append("target_version=%s" % self.target_version)
title = self.distribution.get_fullname()
! lines.append("title=%s" % repr(title)[1:-1])
import time
import distutils
build_info = "Build %s with distutils-%s" % \
! (time.ctime(time.time()), distutils.__version__)
! lines.append("build_info=%s" % build_info)
! return string.join(lines, "\n")
# get_inidata()
***************
*** 184,197 ****
installer_name = os.path.join(self.dist_dir,
"%s.win32.exe" % fullname)
! self.announce ("creating %s" % installer_name)
! file = open (installer_name, "wb")
! file.write (self.get_exe_bytes ())
! file.write (cfgdata)
! header = struct.pack ("<ii",
! 0x12345679, # tag
! len (cfgdata)) # length
! file.write (header)
! file.write (open (arcname, "rb").read())
# create_exe()
--- 184,197 ----
installer_name = os.path.join(self.dist_dir,
"%s.win32.exe" % fullname)
! self.announce("creating %s" % installer_name)
! file = open(installer_name, "wb")
! file.write(self.get_exe_bytes())
! file.write(cfgdata)
! header = struct.pack("<ii",
! 0x12345679, # tag
! len(cfgdata)) # length
! file.write(header)
! file.write(open(arcname, "rb").read())
# create_exe()
***************
*** 199,203 ****
def get_exe_bytes (self):
import base64
! return base64.decodestring (EXEDATA)
# class bdist_wininst
--- 199,203 ----
def get_exe_bytes (self):
import base64
! return base64.decodestring(EXEDATA)
# class bdist_wininst
***************
*** 206,217 ****
# recreate EXEDATA from wininst.exe by rewriting this file
import re, base64
! moddata = open ("bdist_wininst.py", "r").read()
! exedata = open ("../../misc/wininst.exe", "rb").read()
! print "wininst.exe length is %d bytes" % len (exedata)
! print "wininst.exe encoded length is %d bytes" % len (base64.encodestring (exedata))
! exp = re.compile ('EXE'+'DATA = """\\\\(\n.*)*\n"""', re.M)
! data = exp.sub ('EXE' + 'DATA = """\\\\\n%s"""' %
! base64.encodestring (exedata), moddata)
! open ("bdist_wininst.py", "w").write (data)
print "bdist_wininst.py recreated"
--- 206,217 ----
# recreate EXEDATA from wininst.exe by rewriting this file
import re, base64
! moddata = open("bdist_wininst.py", "r").read()
! exedata = open("../../misc/wininst.exe", "rb").read()
! print "wininst.exe length is %d bytes" % len(exedata)
! print "wininst.exe encoded length is %d bytes" % len(base64.encodestring(exedata))
! exp = re.compile('EXE'+'DATA = """\\\\(\n.*)*\n"""', re.M)
! data = exp.sub('EXE' + 'DATA = """\\\\\n%s"""' %
! base64.encodestring(exedata), moddata)
! open("bdist_wininst.py", "w").write(data)
print "bdist_wininst.py recreated"
Index: build.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/command/build.py,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -r1.29 -r1.30
*** build.py 2000/09/30 17:08:12 1.29
--- build.py 2000/09/30 18:27:54 1.30
***************
*** 71,78 ****
# them for a given distribution, though --
if self.build_purelib is None:
! self.build_purelib = os.path.join (self.build_base, 'lib')
if self.build_platlib is None:
! self.build_platlib = os.path.join (self.build_base,
! 'lib' + plat_specifier)
# 'build_lib' is the actual directory that we will use for this
--- 71,78 ----
# them for a given distribution, though --
if self.build_purelib is None:
! self.build_purelib = os.path.join(self.build_base, 'lib')
if self.build_platlib is None:
! self.build_platlib = os.path.join(self.build_base,
! 'lib' + plat_specifier)
# 'build_lib' is the actual directory that we will use for this
***************
*** 88,95 ****
# "build/temp.<plat>"
if self.build_temp is None:
! self.build_temp = os.path.join (self.build_base,
! 'temp' + plat_specifier)
if self.build_scripts is None:
! self.build_scripts = os.path.join (self.build_base, 'scripts')
# finalize_options ()
--- 88,95 ----
# "build/temp.<plat>"
if self.build_temp is None:
! self.build_temp = os.path.join(self.build_base,
! 'temp' + plat_specifier)
if self.build_scripts is None:
! self.build_scripts = os.path.join(self.build_base, 'scripts')
# finalize_options ()
Index: build_clib.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/command/build_clib.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** build_clib.py 2000/09/25 01:41:14 1.20
--- build_clib.py 2000/09/30 18:27:54 1.21
***************
*** 81,100 ****
# by-products, at least from the point of view of building Python
# extensions -- but I want to keep my options open.
! self.set_undefined_options ('build',
! ('build_temp', 'build_clib'),
! ('build_temp', 'build_temp'),
! ('compiler', 'compiler'),
! ('debug', 'debug'),
! ('force', 'force'))
self.libraries = self.distribution.libraries
if self.libraries:
! self.check_library_list (self.libraries)
if self.include_dirs is None:
self.include_dirs = self.distribution.include_dirs or []
! if type (self.include_dirs) is StringType:
! self.include_dirs = string.split (self.include_dirs,
! os.pathsep)
# XXX same as for build_ext -- what about 'self.define' and
--- 81,100 ----
# by-products, at least from the point of view of building Python
# extensions -- but I want to keep my options open.
! self.set_undefined_options('build',
! ('build_temp', 'build_clib'),
! ('build_temp', 'build_temp'),
! ('compiler', 'compiler'),
! ('debug', 'debug'),
! ('force', 'force'))
self.libraries = self.distribution.libraries
if self.libraries:
! self.check_library_list(self.libraries)
if self.include_dirs is None:
self.include_dirs = self.distribution.include_dirs or []
! if type(self.include_dirs) is StringType:
! self.include_dirs = string.split(self.include_dirs,
! os.pathsep)
# XXX same as for build_ext -- what about 'self.define' and
***************
*** 111,131 ****
# Yech -- this is cut 'n pasted from build_ext.py!
from distutils.ccompiler import new_compiler
! self.compiler = new_compiler (compiler=self.compiler,
! verbose=self.verbose,
! dry_run=self.dry_run,
! force=self.force)
customize_compiler(self.compiler)
if self.include_dirs is not None:
! self.compiler.set_include_dirs (self.include_dirs)
if self.define is not None:
# 'define' option is a list of (name,value) tuples
for (name,value) in self.define:
! self.compiler.define_macro (name, value)
if self.undef is not None:
for macro in self.undef:
! self.compiler.undefine_macro (macro)
! self.build_libraries (self.libraries)
# run()
--- 111,131 ----
# Yech -- this is cut 'n pasted from build_ext.py!
from distutils.ccompiler import new_compiler
! self.compiler = new_compiler(compiler=self.compiler,
! verbose=self.verbose,
! dry_run=self.dry_run,
! force=self.force)
customize_compiler(self.compiler)
if self.include_dirs is not None:
! self.compiler.set_include_dirs(self.include_dirs)
if self.define is not None:
# 'define' option is a list of (name,value) tuples
for (name,value) in self.define:
! self.compiler.define_macro(name, value)
if self.undef is not None:
for macro in self.undef:
! self.compiler.undefine_macro(macro)
! self.build_libraries(self.libraries)
# run()
***************
*** 142,155 ****
# with only names changed to protect the innocent!
! if type (libraries) is not ListType:
raise DistutilsSetupError, \
"'libraries' option must be a list of tuples"
for lib in libraries:
! if type (lib) is not TupleType and len (lib) != 2:
raise DistutilsSetupError, \
"each element of 'libraries' must a 2-tuple"
! if type (lib[0]) is not StringType:
raise DistutilsSetupError, \
"first element of each tuple in 'libraries' " + \
--- 142,155 ----
# with only names changed to protect the innocent!
! if type(libraries) is not ListType:
raise DistutilsSetupError, \
"'libraries' option must be a list of tuples"
for lib in libraries:
! if type(lib) is not TupleType and len(lib) != 2:
raise DistutilsSetupError, \
"each element of 'libraries' must a 2-tuple"
! if type(lib[0]) is not StringType:
raise DistutilsSetupError, \
"first element of each tuple in 'libraries' " + \
***************
*** 161,165 ****
lib[0]
! if type (lib[1]) is not DictionaryType:
raise DistutilsSetupError, \
"second element of each tuple in 'libraries' " + \
--- 161,165 ----
lib[0]
! if type(lib[1]) is not DictionaryType:
raise DistutilsSetupError, \
"second element of each tuple in 'libraries' " + \
***************
*** 179,183 ****
lib_names = []
for (lib_name, build_info) in self.libraries:
! lib_names.append (lib_name)
return lib_names
--- 179,183 ----
lib_names = []
for (lib_name, build_info) in self.libraries:
! lib_names.append(lib_name)
return lib_names
***************
*** 190,220 ****
for (lib_name, build_info) in libraries:
! sources = build_info.get ('sources')
! if sources is None or type (sources) not in (ListType, TupleType):
raise DistutilsSetupError, \
("in 'libraries' option (library '%s'), " +
"'sources' must be present and must be " +
"a list of source filenames") % lib_name
! sources = list (sources)
! self.announce ("building '%s' library" % lib_name)
# First, compile the source code to object files in the library
# directory. (This should probably change to putting object
# files in a temporary build directory.)
! macros = build_info.get ('macros')
! include_dirs = build_info.get ('include_dirs')
! objects = self.compiler.compile (sources,
! output_dir=self.build_temp,
! macros=macros,
! include_dirs=include_dirs,
! debug=self.debug)
# Now "link" the object files together into a static library.
# (On Unix at least, this isn't really linking -- it just
# builds an archive. Whatever.)
! self.compiler.create_static_lib (objects, lib_name,
! output_dir=self.build_clib,
! debug=self.debug)
# for libraries
--- 190,220 ----
for (lib_name, build_info) in libraries:
! sources = build_info.get('sources')
! if sources is None or type(sources) not in (ListType, TupleType):
raise DistutilsSetupError, \
("in 'libraries' option (library '%s'), " +
"'sources' must be present and must be " +
"a list of source filenames") % lib_name
! sources = list(sources)
! self.announce("building '%s' library" % lib_name)
# First, compile the source code to object files in the library
# directory. (This should probably change to putting object
# files in a temporary build directory.)
! macros = build_info.get('macros')
! include_dirs = build_info.get('include_dirs')
! objects = self.compiler.compile(sources,
! output_dir=self.build_temp,
! macros=macros,
! include_dirs=include_dirs,
! debug=self.debug)
# Now "link" the object files together into a static library.
# (On Unix at least, this isn't really linking -- it just
# builds an archive. Whatever.)
! self.compiler.create_static_lib(objects, lib_name,
! output_dir=self.build_clib,
! debug=self.debug)
# for libraries
Index: build_ext.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/command/build_ext.py,v
retrieving revision 1.67
retrieving revision 1.68
diff -C2 -r1.67 -r1.68
*** build_ext.py 2000/09/28 19:28:35 1.67
--- build_ext.py 2000/09/30 18:27:54 1.68
***************
*** 113,122 ****
from distutils import sysconfig
! self.set_undefined_options ('build',
! ('build_lib', 'build_lib'),
! ('build_temp', 'build_temp'),
! ('compiler', 'compiler'),
! ('debug', 'debug'),
! ('force', 'force'))
if self.package is None:
--- 113,122 ----
from distutils import sysconfig
! self.set_undefined_options('build',
! ('build_lib', 'build_lib'),
! ('build_temp', 'build_temp'),
! ('compiler', 'compiler'),
! ('debug', 'debug'),
! ('force', 'force'))
if self.package is None:
***************
*** 132,146 ****
if self.include_dirs is None:
self.include_dirs = self.distribution.include_dirs or []
! if type (self.include_dirs) is StringType:
! self.include_dirs = string.split (self.include_dirs,
! os.pathsep)
# Put the Python "system" include dir at the end, so that
# any local include dirs take precedence.
! self.include_dirs.append (py_include)
if plat_py_include != py_include:
! self.include_dirs.append (plat_py_include)
! if type (self.libraries) is StringType:
self.libraries = [self.libraries]
--- 132,145 ----
if self.include_dirs is None:
self.include_dirs = self.distribution.include_dirs or []
! if type(self.include_dirs) is StringType:
! self.include_dirs = string.split(self.include_dirs, os.pathsep)
# Put the Python "system" include dir at the end, so that
# any local include dirs take precedence.
! self.include_dirs.append(py_include)
if plat_py_include != py_include:
! self.include_dirs.append(plat_py_include)
! if type(self.libraries) is StringType:
self.libraries = [self.libraries]
***************
*** 158,166 ****
# also Python's library directory must be appended to library_dirs
if os.name == 'nt':
! self.library_dirs.append (os.path.join(sys.exec_prefix, 'libs'))
if self.debug:
! self.build_temp = os.path.join (self.build_temp, "Debug")
else:
! self.build_temp = os.path.join (self.build_temp, "Release")
# finalize_options ()
--- 157,165 ----
# also Python's library directory must be appended to library_dirs
if os.name == 'nt':
! self.library_dirs.append(os.path.join(sys.exec_prefix, 'libs'))
if self.debug:
! self.build_temp = os.path.join(self.build_temp, "Debug")
else:
! self.build_temp = os.path.join(self.build_temp, "Release")
# finalize_options ()
***************
*** 189,202 ****
# linking extensions.
if self.distribution.has_c_libraries():
! build_clib = self.get_finalized_command ('build_clib')
! self.libraries.extend (build_clib.get_library_names() or [])
! self.library_dirs.append (build_clib.build_clib)
# Setup the CCompiler object that we'll use to do all the
# compiling and linking
! self.compiler = new_compiler (compiler=self.compiler,
! verbose=self.verbose,
! dry_run=self.dry_run,
! force=self.force)
customize_compiler(self.compiler)
--- 188,201 ----
# linking extensions.
if self.distribution.has_c_libraries():
! build_clib = self.get_finalized_command('build_clib')
! self.libraries.extend(build_clib.get_library_names() or [])
! self.library_dirs.append(build_clib.build_clib)
# Setup the CCompiler object that we'll use to do all the
# compiling and linking
! self.compiler = new_compiler(compiler=self.compiler,
! verbose=self.verbose,
! dry_run=self.dry_run,
! force=self.force)
customize_compiler(self.compiler)
***************
*** 206,228 ****
# all compiling and linking done here.
if self.include_dirs is not None:
! self.compiler.set_include_dirs (self.include_dirs)
if self.define is not None:
# 'define' option is a list of (name,value) tuples
for (name,value) in self.define:
! self.compiler.define_macro (name, value)
if self.undef is not None:
for macro in self.undef:
! self.compiler.undefine_macro (macro)
if self.libraries is not None:
! self.compiler.set_libraries (self.libraries)
if self.library_dirs is not None:
! self.compiler.set_library_dirs (self.library_dirs)
if self.rpath is not None:
! self.compiler.set_runtime_library_dirs (self.rpath)
if self.link_objects is not None:
! self.compiler.set_link_objects (self.link_objects)
# Now actually compile and link everything.
! self.build_extensions ()
# run ()
--- 205,227 ----
# all compiling and linking done here.
if self.include_dirs is not None:
! self.compiler.set_include_dirs(self.include_dirs)
if self.define is not None:
# 'define' option is a list of (name,value) tuples
for (name,value) in self.define:
! self.compiler.define_macro(name, value)
if self.undef is not None:
for macro in self.undef:
! self.compiler.undefine_macro(macro)
if self.libraries is not None:
! self.compiler.set_libraries(self.libraries)
if self.library_dirs is not None:
! self.compiler.set_library_dirs(self.library_dirs)
if self.rpath is not None:
! self.compiler.set_runtime_library_dirs(self.rpath)
if self.link_objects is not None:
! self.compiler.set_link_objects(self.link_objects)
# Now actually compile and link everything.
! self.build_extensions()
# run ()
***************
*** 321,325 ****
# Wouldn't it be neat if we knew the names of header files too...
for ext in self.extensions:
! filenames.extend (ext.sources)
return filenames
--- 320,324 ----
# Wouldn't it be neat if we knew the names of header files too...
for ext in self.extensions:
! filenames.extend(ext.sources)
return filenames
***************
*** 331,335 ****
# done in the same run as a 'build_extensions()' call (in fact, we
# can probably assume that it *isn't*!).
! self.check_extensions_list (self.extensions)
# And build the list of output (built) filenames. Note that this
--- 330,334 ----
# done in the same run as a 'build_extensions()' call (in fact, we
# can probably assume that it *isn't*!).
! self.check_extensions_list(self.extensions)
# And build the list of output (built) filenames. Note that this
***************
*** 338,344 ****
outputs = []
for ext in self.extensions:
! fullname = self.get_ext_fullname (ext.name)
! outputs.append (os.path.join (self.build_lib,
! self.get_ext_filename(fullname)))
return outputs
--- 337,343 ----
outputs = []
for ext in self.extensions:
! fullname = self.get_ext_fullname(ext.name)
! outputs.append(os.path.join(self.build_lib,
! self.get_ext_filename(fullname)))
return outputs
***************
*** 349,386 ****
# First, sanity-check the 'extensions' list
! self.check_extensions_list (self.extensions)
for ext in self.extensions:
sources = ext.sources
! if sources is None or type (sources) not in (ListType, TupleType):
raise DistutilsSetupError, \
("in 'ext_modules' option (extension '%s'), " +
"'sources' must be present and must be " +
"a list of source filenames") % ext.name
! sources = list (sources)
! fullname = self.get_ext_fullname (ext.name)
if self.inplace:
# ignore build-lib -- put the compiled extension into
# the source tree along with pure Python modules
! modpath = string.split (fullname, '.')
! package = string.join (modpath[0:-1], '.')
base = modpath[-1]
! build_py = self.get_finalized_command ('build_py')
! package_dir = build_py.get_package_dir (package)
! ext_filename = os.path.join (package_dir,
! self.get_ext_filename(base))
else:
! ext_filename = os.path.join (self.build_lib,
! self.get_ext_filename(fullname))
if not (self.force or newer_group(sources, ext_filename, 'newer')):
! self.announce ("skipping '%s' extension (up-to-date)" %
! ext.name)
continue # 'for' loop over all extensions
else:
! self.announce ("building '%s' extension" % ext.name)
# First, scan the sources for SWIG definition files (.i), run
--- 348,385 ----
# First, sanity-check the 'extensions' list
! self.check_extensions_list(self.extensions)
for ext in self.extensions:
sources = ext.sources
! if sources is None or type(sources) not in (ListType, TupleType):
raise DistutilsSetupError, \
("in 'ext_modules' option (extension '%s'), " +
"'sources' must be present and must be " +
"a list of source filenames") % ext.name
! sources = list(sources)
! fullname = self.get_ext_fullname(ext.name)
if self.inplace:
# ignore build-lib -- put the compiled extension into
# the source tree along with pure Python modules
! modpath = string.split(fullname, '.')
! package = string.join(modpath[0:-1], '.')
base = modpath[-1]
! build_py = self.get_finalized_command('build_py')
! package_dir = build_py.get_package_dir(package)
! ext_filename = os.path.join(package_dir,
! self.get_ext_filename(base))
else:
! ext_filename = os.path.join(self.build_lib,
! self.get_ext_filename(fullname))
if not (self.force or newer_group(sources, ext_filename, 'newer')):
! self.announce("skipping '%s' extension (up-to-date)" %
! ext.name)
continue # 'for' loop over all extensions
else:
! self.announce("building '%s' extension" % ext.name)
# First, scan the sources for SWIG definition files (.i), run
***************
*** 417,426 ****
extra_args.extend(string.split(os.environ['CFLAGS']))
! objects = self.compiler.compile (sources,
! output_dir=self.build_temp,
! macros=macros,
! include_dirs=ext.include_dirs,
! debug=self.debug,
! extra_postargs=extra_args)
# Now link the object files together into a "shared object" --
--- 416,425 ----
extra_args.extend(string.split(os.environ['CFLAGS']))
! objects = self.compiler.compile(sources,
! output_dir=self.build_temp,
! macros=macros,
! include_dirs=ext.include_dirs,
! debug=self.debug,
! extra_postargs=extra_args)
# Now link the object files together into a "shared object" --
***************
*** 428,436 ****
# that go into the mix.
if ext.extra_objects:
! objects.extend (ext.extra_objects)
extra_args = ext.extra_link_args or []
! self.compiler.link_shared_object (
objects, ext_filename,
libraries=self.get_libraries(ext),
--- 427,435 ----
# that go into the mix.
if ext.extra_objects:
! objects.extend(ext.extra_objects)
extra_args = ext.extra_link_args or []
! self.compiler.link_shared_object(
objects, ext_filename,
libraries=self.get_libraries(ext),
***************
*** 482,490 ****
swig_cmd = [swig, "-python", "-dnone", "-ISWIG"]
if self.swig_cpp:
! swig_cmd.append ("-c++")
for source in swig_sources:
target = swig_targets[source]
! self.announce ("swigging %s to %s" % (source, target))
self.spawn(swig_cmd + ["-o", target, source])
--- 481,489 ----
swig_cmd = [swig, "-python", "-dnone", "-ISWIG"]
if self.swig_cpp:
! swig_cmd.append("-c++")
for source in swig_sources:
target = swig_targets[source]
! self.announce("swigging %s to %s" % (source, target))
self.spawn(swig_cmd + ["-o", target, source])
***************
*** 508,512 ****
for vers in ("1.3", "1.2", "1.1"):
fn = os.path.join("c:\\swig%s" % vers, "swig.exe")
! if os.path.isfile (fn):
return fn
else:
--- 507,511 ----
for vers in ("1.3", "1.2", "1.1"):
fn = os.path.join("c:\\swig%s" % vers, "swig.exe")
! if os.path.isfile(fn):
return fn
else:
***************
*** 536,545 ****
from distutils.sysconfig import get_config_var
! ext_path = string.split (ext_name, '.')
# extensions in debug_mode are named 'module_d.pyd' under windows
so_ext = get_config_var('SO')
if os.name == 'nt' and self.debug:
! return apply (os.path.join, ext_path) + '_d' + so_ext
! return apply (os.path.join, ext_path) + so_ext
def get_export_symbols (self, ext):
--- 535,544 ----
from distutils.sysconfig import get_config_var
! ext_path = string.split(ext_name, '.')
# extensions in debug_mode are named 'module_d.pyd' under windows
so_ext = get_config_var('SO')
if os.name == 'nt' and self.debug:
! return apply(os.path.join, ext_path) + '_d' + so_ext
! return apply(os.path.join, ext_path) + so_ext
def get_export_symbols (self, ext):
Index: build_py.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/command/build_py.py,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** build_py.py 2000/09/30 17:33:05 1.31
--- build_py.py 2000/09/30 18:27:54 1.32
***************
*** 35,41 ****
def finalize_options (self):
! self.set_undefined_options ('build',
! ('build_lib', 'build_lib'),
! ('force', 'force'))
# Get the distribution options that are aliases for build_py
--- 35,41 ----
def finalize_options (self):
! self.set_undefined_options('build',
! ('build_lib', 'build_lib'),
! ('force', 'force'))
# Get the distribution options that are aliases for build_py
***************
*** 84,90 ****
# Now we're down to two cases: 'py_modules' only and 'packages' only.
if self.py_modules:
! self.build_modules ()
else:
! self.build_packages ()
# run ()
--- 84,90 ----
# Now we're down to two cases: 'py_modules' only and 'packages' only.
if self.py_modules:
! self.build_modules()
else:
! self.build_packages()
# run ()
***************
*** 96,104 ****
(at least according to the 'package_dir' option, if any)."""
! path = string.split (package, '.')
if not self.package_dir:
if path:
! return apply (os.path.join, path)
else:
return ''
--- 96,104 ----
(at least according to the 'package_dir' option, if any)."""
! path = string.split(package, '.')
if not self.package_dir:
if path:
! return apply(os.path.join, path)
else:
return ''
***************
*** 107,117 ****
while path:
try:
! pdir = self.package_dir[string.join (path, '.')]
except KeyError:
! tail.insert (0, path[-1])
del path[-1]
else:
! tail.insert (0, pdir)
! return apply (os.path.join, tail)
else:
# Oops, got all the way through 'path' without finding a
--- 107,117 ----
while path:
try:
! pdir = self.package_dir[string.join(path, '.')]
except KeyError:
! tail.insert(0, path[-1])
del path[-1]
else:
! tail.insert(0, pdir)
! return apply(os.path.join, tail)
else:
# Oops, got all the way through 'path' without finding a
***************
*** 127,131 ****
if tail:
! return apply (os.path.join, tail)
else:
return ''
--- 127,131 ----
if tail:
! return apply(os.path.join, tail)
else:
return ''
***************
*** 141,148 ****
# circumvent them.
if package_dir != "":
! if not os.path.exists (package_dir):
raise DistutilsFileError, \
"package directory '%s' does not exist" % package_dir
! if not os.path.isdir (package_dir):
raise DistutilsFileError, \
("supposed package directory '%s' exists, " +
--- 141,148 ----
# circumvent them.
if package_dir != "":
! if not os.path.exists(package_dir):
raise DistutilsFileError, \
"package directory '%s' does not exist" % package_dir
! if not os.path.isdir(package_dir):
raise DistutilsFileError, \
("supposed package directory '%s' exists, " +
***************
*** 151,160 ****
# Require __init__.py for all but the "root package"
if package:
! init_py = os.path.join (package_dir, "__init__.py")
! if os.path.isfile (init_py):
return init_py
else:
! self.warn (("package init file '%s' not found " +
! "(or not a regular file)") % init_py)
# Either not in a package at all (__init__.py not expected), or
--- 151,160 ----
# Require __init__.py for all but the "root package"
if package:
! init_py = os.path.join(package_dir, "__init__.py")
! if os.path.isfile(init_py):
return init_py
else:
! self.warn(("package init file '%s' not found " +
! "(or not a regular file)") % init_py)
# Either not in a package at all (__init__.py not expected), or
***************
*** 166,172 ****
def check_module (self, module, module_file):
! if not os.path.isfile (module_file):
! self.warn ("file %s (for module %s) not found" %
! (module_file, module))
return 0
else:
--- 166,172 ----
def check_module (self, module, module_file):
! if not os.path.isfile(module_file):
! self.warn("file %s (for module %s) not found" %
! (module_file, module))
return 0
else:
***************
*** 177,190 ****
def find_package_modules (self, package, package_dir):
! self.check_package (package, package_dir)
! module_files = glob (os.path.join (package_dir, "*.py"))
modules = []
setup_script = os.path.abspath(self.distribution.script_name)
for f in module_files:
! abs_f = os.path.abspath (f)
if abs_f != setup_script:
! module = os.path.splitext (os.path.basename (f))[0]
! modules.append ((package, module, f))
else:
self.debug_print("excluding %s" % setup_script)
--- 177,190 ----
def find_package_modules (self, package, package_dir):
! self.check_package(package, package_dir)
! module_files = glob(os.path.join(package_dir, "*.py"))
modules = []
setup_script = os.path.abspath(self.distribution.script_name)
for f in module_files:
! abs_f = os.path.abspath(f)
if abs_f != setup_script:
! module = os.path.splitext(os.path.basename(f))[0]
! modules.append((package, module, f))
else:
self.debug_print("excluding %s" % setup_script)
***************
*** 219,223 ****
for module in self.py_modules:
! path = string.split (module, '.')
package = string.join(path[0:-1], '.')
module_base = path[-1]
--- 219,223 ----
for module in self.py_modules:
! path = string.split(module, '.')
package = string.join(path[0:-1], '.')
module_base = path[-1]
***************
*** 226,234 ****
(package_dir, checked) = packages[package]
except KeyError:
! package_dir = self.get_package_dir (package)
checked = 0
if not checked:
! init_py = self.check_package (package, package_dir)
packages[package] = (package_dir, 1)
if init_py:
--- 226,234 ----
(package_dir, checked) = packages[package]
except KeyError:
! package_dir = self.get_package_dir(package)
checked = 0
if not checked:
! init_py = self.check_package(package, package_dir)
packages[package] = (package_dir, 1)
if init_py:
***************
*** 238,246 ****
# (so greedy closed-source bastards can distribute Python
# modules too)
! module_file = os.path.join (package_dir, module_base + ".py")
! if not self.check_module (module, module_file):
continue
! modules.append ((package, module_base, module_file))
return modules
--- 238,246 ----
# (so greedy closed-source bastards can distribute Python
# modules too)
! module_file = os.path.join(package_dir, module_base + ".py")
! if not self.check_module(module, module_file):
continue
! modules.append((package, module_base, module_file))
return modules
***************
*** 257,267 ****
if self.py_modules:
! modules = self.find_modules ()
else:
modules = []
for package in self.packages:
! package_dir = self.get_package_dir (package)
! m = self.find_package_modules (package, package_dir)
! modules.extend (m)
return modules
--- 257,267 ----
if self.py_modules:
! modules = self.find_modules()
else:
modules = []
for package in self.packages:
! package_dir = self.get_package_dir(package)
! m = self.find_package_modules(package, package_dir)
! modules.extend(m)
return modules
***************
*** 272,279 ****
def get_source_files (self):
! modules = self.find_all_modules ()
filenames = []
for module in modules:
! filenames.append (module[-1])
return filenames
--- 272,279 ----
def get_source_files (self):
! modules = self.find_all_modules()
filenames = []
for module in modules:
! filenames.append(module[-1])
return filenames
***************
*** 282,302 ****
def get_module_outfile (self, build_dir, package, module):
outfile_path = [build_dir] + list(package) + [module + ".py"]
! return apply (os.path.join, outfile_path)
def get_outputs (self):
! modules = self.find_all_modules ()
outputs = []
for (package, module, module_file) in modules:
! package = string.split (package, '.')
! outputs.append (self.get_module_outfile (self.build_lib,
! package, module))
return outputs
def build_module (self, module, module_file, package):
! if type (package) is StringType:
! package = string.split (package, '.')
! elif type (package) not in (ListType, TupleType):
raise TypeError, \
"'package' must be a string (dot-separated), list, or tuple"
--- 282,302 ----
def get_module_outfile (self, build_dir, package, module):
outfile_path = [build_dir] + list(package) + [module + ".py"]
! return apply(os.path.join, outfile_path)
def get_outputs (self):
! modules = self.find_all_modules()
outputs = []
for (package, module, module_file) in modules:
! package = string.split(package, '.')
! outputs.append(self.get_module_outfile(self.build_lib,
! package, module))
return outputs
def build_module (self, module, module_file, package):
! if type(package) is StringType:
! package = string.split(package, '.')
! elif type(package) not in (ListType, TupleType):
raise TypeError, \
"'package' must be a string (dot-separated), list, or tuple"
***************
*** 305,312 ****
# easy, we just copy it somewhere under self.build_lib (the build
# directory for Python source).
! outfile = self.get_module_outfile (self.build_lib, package, module)
! dir = os.path.dirname (outfile)
! self.mkpath (dir)
! return self.copy_file (module_file, outfile, preserve_mode=0)
--- 305,312 ----
# easy, we just copy it somewhere under self.build_lib (the build
# directory for Python source).
! outfile = self.get_module_outfile(self.build_lib, package, module)
! dir = os.path.dirname(outfile)
! self.mkpath(dir)
! return self.copy_file(module_file, outfile, preserve_mode=0)
***************
*** 320,324 ****
# (Actually, it gets copied to the directory for this package
# under self.build_lib.)
! self.build_module (module, module_file, package)
# build_modules ()
--- 320,324 ----
# (Actually, it gets copied to the directory for this package
# under self.build_lib.)
! self.build_module(module, module_file, package)
# build_modules ()
***************
*** 338,343 ****
# the .py file, relative to the current directory
# (ie. including 'package_dir').
! package_dir = self.get_package_dir (package)
! modules = self.find_package_modules (package, package_dir)
# Now loop over the modules we found, "building" each one (just
--- 338,343 ----
# the .py file, relative to the current directory
# (ie. including 'package_dir').
! package_dir = self.get_package_dir(package)
! modules = self.find_package_modules(package, package_dir)
# Now loop over the modules we found, "building" each one (just
***************
*** 345,349 ****
for (package_, module, module_file) in modules:
assert package == package_
! self.build_module (module, module_file, package)
# build_packages ()
--- 345,349 ----
for (package_, module, module_file) in modules:
assert package == package_
! self.build_module(module, module_file, package)
# build_packages ()
Index: build_scripts.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/command/build_scripts.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** build_scripts.py 2000/09/25 01:41:15 1.5
--- build_scripts.py 2000/09/30 18:27:54 1.6
***************
*** 33,39 ****
def finalize_options (self):
! self.set_undefined_options ('build',
! ('build_scripts', 'build_dir'),
! ('force', 'force'))
self.scripts = self.distribution.scripts
--- 33,39 ----
def finalize_options (self):
! self.set_undefined_options('build',
! ('build_scripts', 'build_dir'),
! ('force', 'force'))
self.scripts = self.distribution.scripts
Index: clean.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/command/clean.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** clean.py 2000/09/25 01:41:15 1.10
--- clean.py 2000/09/30 18:27:54 1.11
***************
*** 51,59 ****
# remove the build/temp.<plat> directory (unless it's already
# gone)
! if os.path.exists (self.build_temp):
! remove_tree (self.build_temp, self.verbose, self.dry_run)
else:
! self.warn ("'%s' does not exist -- can't clean it" %
! self.build_temp)
if self.all:
--- 51,59 ----
# remove the build/temp.<plat> directory (unless it's already
# gone)
! if os.path.exists(self.build_temp):
! remove_tree(self.build_temp, self.verbose, self.dry_run)
else:
! self.warn("'%s' does not exist -- can't clean it" %
! self.build_temp)
if self.all:
***************
*** 62,70 ****
self.bdist_base,
self.build_scripts):
! if os.path.exists (directory):
! remove_tree (directory, self.verbose, self.dry_run)
else:
! self.warn ("'%s' does not exist -- can't clean it" %
! directory)
# just for the heck of it, try to remove the base build directory:
--- 62,70 ----
self.bdist_base,
self.build_scripts):
! if os.path.exists(directory):
! remove_tree(directory, self.verbose, self.dry_run)
else:
! self.warn("'%s' does not exist -- can't clean it" %
! directory)
# just for the heck of it, try to remove the base build directory:
***************
*** 72,77 ****
if not self.dry_run:
try:
! os.rmdir (self.build_base)
! self.announce ("removing '%s'" % self.build_base)
except OSError:
pass
--- 72,77 ----
if not self.dry_run:
try:
! os.rmdir(self.build_base)
! self.announce("removing '%s'" % self.build_base)
except OSError:
pass
Index: config.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/command/config.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** config.py 2000/06/27 01:21:22 1.3
--- config.py 2000/09/30 18:27:54 1.4
***************
*** 88,95 ****
from distutils.ccompiler import CCompiler, new_compiler
if not isinstance(self.compiler, CCompiler):
! self.compiler = new_compiler (compiler=self.compiler,
! verbose=self.noisy,
! dry_run=self.dry_run,
! force=1)
if self.include_dirs:
self.compiler.set_include_dirs(self.include_dirs)
--- 88,95 ----
from distutils.ccompiler import CCompiler, new_compiler
if not isinstance(self.compiler, CCompiler):
! self.compiler = new_compiler(compiler=self.compiler,
! verbose=self.noisy,
! dry_run=self.dry_run,
! force=1)
if self.include_dirs:
self.compiler.set_include_dirs(self.include_dirs)
Index: install.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/command/install.py,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -r1.49 -r1.50
*** install.py 2000/09/30 17:05:37 1.49
--- install.py 2000/09/30 18:27:54 1.50
***************
*** 211,218 ****
else:
if self.exec_prefix:
! self.warn ("exec-prefix option ignored on this platform")
self.exec_prefix = None
if self.home:
! self.warn ("home option ignored on this platform")
self.home = None
--- 211,218 ----
else:
if self.exec_prefix:
! self.warn("exec-prefix option ignored on this platform")
self.exec_prefix = None
if self.home:
! self.warn("home option ignored on this platform")
self.home = None
***************
*** 225,236 ****
# INSTALL_SCHEME dictionary above. Phew!
! self.dump_dirs ("pre-finalize_{unix,other}")
if os.name == 'posix':
! self.finalize_unix ()
else:
! self.finalize_other ()
! self.dump_dirs ("post-finalize_{unix,other}()")
# Expand configuration variables, tilde, etc. in self.install_base
--- 225,236 ----
# INSTALL_SCHEME dictionary above. Phew!
! self.dump_dirs("pre-finalize_{unix,other}")
if os.name == 'posix':
! self.finalize_unix()
else:
! self.finalize_other()
! self.dump_dirs("post-finalize_{unix,other}()")
# Expand configuration variables, tilde, etc. in self.install_base
***************
*** 251,257 ****
'exec_prefix': exec_prefix,
}
! self.expand_basedirs ()
! self.dump_dirs ("post-expand_basedirs()")
# Now define config vars for the base directories so we can expand
--- 251,257 ----
'exec_prefix': exec_prefix,
}
! self.expand_basedirs()
! self.dump_dirs("post-expand_basedirs()")
# Now define config vars for the base directories so we can expand
***************
*** 263,273 ****
from pprint import pprint
print "config vars:"
! pprint (self.config_vars)
# Expand "~" and configuration variables in the installation
# directories.
! self.expand_dirs ()
! self.dump_dirs ("post-expand_dirs()")
# Pick the actual directory to install all modules to: either
--- 263,273 ----
from pprint import pprint
print "config vars:"
! pprint(self.config_vars)
# Expand "~" and configuration variables in the installation
# directories.
! self.expand_dirs()
! self.dump_dirs("post-expand_dirs()")
# Pick the actual directory to install all modules to: either
***************
*** 291,297 ****
# non-packagized module distributions (hello, Numerical Python!) to
# get their own directories.
! self.handle_extra_path ()
self.install_libbase = self.install_lib # needed for .pth file
! self.install_lib = os.path.join (self.install_lib, self.extra_dirs)
# If a new root directory was supplied, make all the installation
--- 291,297 ----
# non-packagized module distributions (hello, Numerical Python!) to
# get their own directories.
! self.handle_extra_path()
self.install_libbase = self.install_lib # needed for .pth file
! self.install_lib = os.path.join(self.install_lib, self.extra_dirs)
# If a new root directory was supplied, make all the installation
***************
*** 301,310 ****
'scripts', 'data', 'headers')
! self.dump_dirs ("after prepending root")
# Find out the build directories, ie. where to install from.
! self.set_undefined_options ('build',
! ('build_base', 'build_base'),
! ('build_lib', 'build_lib'))
# Punt on doc directories for now -- after all, we're punting on
--- 301,310 ----
'scripts', 'data', 'headers')
! self.dump_dirs("after prepending root")
# Find out the build directories, ie. where to install from.
! self.set_undefined_options('build',
! ('build_base', 'build_base'),
! ('build_lib', 'build_lib'))
# Punt on doc directories for now -- after all, we're punting on
***************
*** 322,327 ****
if opt_name[-1] == "=":
opt_name = opt_name[0:-1]
! opt_name = string.translate (opt_name, longopt_xlate)
! val = getattr (self, opt_name)
print " %s: %s" % (opt_name, val)
--- 322,327 ----
if opt_name[-1] == "=":
opt_name = opt_name[0:-1]
! opt_name = string.translate(opt_name, longopt_xlate)
! val = getattr(self, opt_name)
print " %s: %s" % (opt_name, val)
***************
*** 343,347 ****
if self.home is not None:
self.install_base = self.install_platbase = self.home
! self.select_scheme ("unix_home")
else:
if self.prefix is None:
--- 343,347 ----
if self.home is not None:
self.install_base = self.install_platbase = self.home
! self.select_scheme("unix_home")
else:
if self.prefix is None:
***************
*** 350,355 ****
"must not supply exec-prefix without prefix"
! self.prefix = os.path.normpath (sys.prefix)
! self.exec_prefix = os.path.normpath (sys.exec_prefix)
else:
--- 350,355 ----
"must not supply exec-prefix without prefix"
! self.prefix = os.path.normpath(sys.prefix)
! self.exec_prefix = os.path.normpath(sys.exec_prefix)
else:
***************
*** 359,363 ****
self.install_base = self.prefix
self.install_platbase = self.exec_prefix
! self.select_scheme ("unix_prefix")
# finalize_unix ()
--- 359,363 ----
self.install_base = self.prefix
self.install_platbase = self.exec_prefix
! self.select_scheme("unix_prefix")
# finalize_unix ()
***************
*** 367,375 ****
if self.prefix is None:
! self.prefix = os.path.normpath (sys.prefix)
self.install_base = self.install_platbase = self.prefix
try:
! self.select_scheme (os.name)
except KeyError:
raise DistutilsPlatformError, \
--- 367,375 ----
if self.prefix is None:
! self.prefix = os.path.normpath(sys.prefix)
self.install_base = self.install_platbase = self.prefix
try:
! self.select_scheme(os.name)
except KeyError:
raise DistutilsPlatformError, \
***************
*** 390,413 ****
def _expand_attrs (self, attrs):
for attr in attrs:
! val = getattr (self, attr)
if val is not None:
if os.name == 'posix':
! val = os.path.expanduser (val)
! val = subst_vars (val, self.config_vars)
! setattr (self, attr, val)
def expand_basedirs (self):
! self._expand_attrs (['install_base',
! 'install_platbase',
! 'root'])
def expand_dirs (self):
! self._expand_attrs (['install_purelib',
! 'install_platlib',
! 'install_lib',
! 'install_headers',
! 'install_scripts',
! 'install_data',])
--- 390,413 ----
def _expand_attrs (self, attrs):
for attr in attrs:
! val = getattr(self, attr)
if val is not None:
if os.name == 'posix':
! val = os.path.expanduser(val)
! val = subst_vars(val, self.config_vars)
! setattr(self, attr, val)
def expand_basedirs (self):
! self._expand_attrs(['install_base',
! 'install_platbase',
! 'root'])
def expand_dirs (self):
! self._expand_attrs(['install_purelib',
! 'install_platlib',
! 'install_lib',
! 'install_headers',
! 'install_scripts',
! 'install_data',])
***************
*** 424,433 ****
if self.extra_path is not None:
! if type (self.extra_path) is StringType:
! self.extra_path = string.split (self.extra_path, ',')
! if len (self.extra_path) == 1:
path_file = extra_dirs = self.extra_path[0]
! elif len (self.extra_path) == 2:
(path_file, extra_dirs) = self.extra_path
else:
--- 424,433 ----
if self.extra_path is not None:
! if type(self.extra_path) is StringType:
! self.extra_path = string.split(self.extra_path, ',')
! if len(self.extra_path) == 1:
path_file = extra_dirs = self.extra_path[0]
! elif len(self.extra_path) == 2:
(path_file, extra_dirs) = self.extra_path
else:
***************
*** 438,442 ****
# convert to local form in case Unix notation used (as it
# should be in setup scripts)
! extra_dirs = convert_path (extra_dirs)
else:
--- 438,442 ----
# convert to local form in case Unix notation used (as it
# should be in setup scripts)
! extra_dirs = convert_path(extra_dirs)
else:
***************
*** 464,475 ****
# Obviously have to build before we can install
if not self.skip_build:
! self.run_command ('build')
# Run all sub-commands (at least those that need to be run)
for cmd_name in self.get_sub_commands():
! self.run_command (cmd_name)
if self.path_file:
! self.create_path_file ()
# write list of installed files, if requested.
--- 464,475 ----
# Obviously have to build before we can install
if not self.skip_build:
! self.run_command('build')
# Run all sub-commands (at least those that need to be run)
for cmd_name in self.get_sub_commands():
! self.run_command(cmd_name)
if self.path_file:
! self.create_path_file()
# write list of installed files, if requested.
***************
*** 478,482 ****
if self.root: # strip any package prefix
root_len = len(self.root)
! for counter in xrange (len (outputs)):
outputs[counter] = outputs[counter][root_len:]
self.execute(write_file,
--- 478,482 ----
if self.root: # strip any package prefix
root_len = len(self.root)
! for counter in xrange(len(outputs)):
outputs[counter] = outputs[counter][root_len:]
self.execute(write_file,
***************
*** 497,506 ****
def create_path_file (self):
! filename = os.path.join (self.install_libbase,
! self.path_file + ".pth")
if self.install_path_file:
! self.execute (write_file,
! (filename, [self.extra_dirs]),
! "creating %s" % filename)
else:
self.warn("path file '%s' not created" % filename)
--- 497,506 ----
def create_path_file (self):
! filename = os.path.join(self.install_libbase,
! self.path_file + ".pth")
if self.install_path_file:
! self.execute(write_file,
! (filename, [self.extra_dirs]),
! "creating %s" % filename)
else:
self.warn("path file '%s' not created" % filename)
***************
*** 514,519 ****
outputs = []
for cmd_name in self.get_sub_commands():
! cmd = self.get_finalized_command (cmd_name)
! outputs.extend (cmd.get_outputs())
return outputs
--- 514,519 ----
outputs = []
for cmd_name in self.get_sub_commands():
! cmd = self.get_finalized_command(cmd_name)
! outputs.extend(cmd.get_outputs())
return outputs
***************
*** 523,528 ****
inputs = []
for cmd_name in self.get_sub_commands():
! cmd = self.get_finalized_command (cmd_name)
! inputs.extend (cmd.get_inputs())
return inputs
--- 523,528 ----
inputs = []
for cmd_name in self.get_sub_commands():
! cmd = self.get_finalized_command(cmd_name)
! inputs.extend(cmd.get_inputs())
return inputs
Index: install_scripts.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/command/install_scripts.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** install_scripts.py 2000/09/25 01:41:15 1.9
--- install_scripts.py 2000/09/30 18:27:54 1.10
***************
*** 34,42 ****
def finalize_options (self):
self.set_undefined_options('build', ('build_scripts', 'build_dir'))
! self.set_undefined_options ('install',
! ('install_scripts', 'install_dir'),
! ('force', 'force'),
! ('skip_build', 'skip_build'),
! )
def run (self):
--- 34,42 ----
def finalize_options (self):
self.set_undefined_options('build', ('build_scripts', 'build_dir'))
! self.set_undefined_options('install',
! ('install_scripts', 'install_dir'),
! ('force', 'force'),
! ('skip_build', 'skip_build'),
! )
def run (self):
Index: sdist.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/command/sdist.py,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -r1.49 -r1.50
*** sdist.py 2000/09/25 01:51:01 1.49
--- sdist.py 2000/09/30 18:27:54 1.50
***************
*** 119,123 ****
"on platform %s" % os.name
! bad_format = archive_util.check_archive_formats (self.formats)
if bad_format:
raise DistutilsOptionError, \
--- 119,123 ----
"on platform %s" % os.name
! bad_format = archive_util.check_archive_formats(self.formats)
if bad_format:
raise DistutilsOptionError, \
***************
*** 136,145 ****
# Ensure that all required meta-data is given; warn if not (but
# don't die, it's not *that* serious!)
! self.check_metadata ()
# Do whatever it takes to get the list of files to process
# (process the manifest template, read an existing manifest,
# whatever). File list is accumulated in 'self.filelist'.
! self.get_file_list ()
# If user just wanted us to regenerate the manifest, stop now.
--- 136,145 ----
# Ensure that all required meta-data is given; warn if not (but
# don't die, it's not *that* serious!)
! self.check_metadata()
# Do whatever it takes to get the list of files to process
# (process the manifest template, read an existing manifest,
# whatever). File list is accumulated in 'self.filelist'.
! self.get_file_list()
# If user just wanted us to regenerate the manifest, stop now.
***************
*** 149,153 ****
# Otherwise, go ahead and create the source distribution tarball,
# or zipfile, or whatever.
! self.make_distribution ()
--- 149,153 ----
# Otherwise, go ahead and create the source distribution tarball,
# or zipfile, or whatever.
! self.make_distribution()
***************
*** 162,184 ****
missing = []
for attr in ('name', 'version', 'url'):
! if not (hasattr (metadata, attr) and getattr (metadata, attr)):
! missing.append (attr)
if missing:
! self.warn ("missing required meta-data: " +
! string.join (missing, ", "))
if metadata.author:
if not metadata.author_email:
! self.warn ("missing meta-data: if 'author' supplied, " +
! "'author_email' must be supplied too")
elif metadata.maintainer:
if not metadata.maintainer_email:
! self.warn ("missing meta-data: if 'maintainer' supplied, " +
! "'maintainer_email' must be supplied too")
else:
! self.warn ("missing meta-data: either (author and author_email) " +
! "or (maintainer and maintainer_email) " +
! "must be supplied")
# check_metadata ()
--- 162,184 ----
missing = []
for attr in ('name', 'version', 'url'):
! if not (hasattr(metadata, attr) and getattr(metadata, attr)):
! missing.append(attr)
if missing:
! self.warn("missing required meta-data: " +
! string.join(missing, ", "))
if metadata.author:
if not metadata.author_email:
! self.warn("missing meta-data: if 'author' supplied, " +
! "'author_email' must be supplied too")
elif metadata.maintainer:
if not metadata.maintainer_email:
! self.warn("missing meta-data: if 'maintainer' supplied, " +
! "'maintainer_email' must be supplied too")
else:
! self.warn("missing meta-data: either (author and author_email) " +
! "or (maintainer and maintainer_email) " +
! "must be supplied")
# check_metadata ()
***************
*** 283,321 ****
standards = [('README', 'README.txt'), self.distribution.script_name]
for fn in standards:
! if type (fn) is TupleType:
alts = fn
got_it = 0
for fn in alts:
! if os.path.exists (fn):
got_it = 1
! self.filelist.append (fn)
break
if not got_it:
! self.warn ("standard file not found: should have one of " +
! string.join (alts, ', '))
else:
! if os.path.exists (fn):
! self.filelist.append (fn)
else:
! self.warn ("standard file '%s' not found" % fn)
optional = ['test/test*.py', 'setup.cfg']
for pattern in optional:
! files = filter (os.path.isfile, glob (pattern))
if files:
! self.filelist.extend (files)
if self.distribution.has_pure_modules():
! build_py = self.get_finalized_command ('build_py')
! self.filelist.extend (build_py.get_source_files ())
if self.distribution.has_ext_modules():
! build_ext = self.get_finalized_command ('build_ext')
! self.filelist.extend (build_ext.get_source_files ())
if self.distribution.has_c_libraries():
! build_clib = self.get_finalized_command ('build_clib')
! self.filelist.extend (build_clib.get_source_files ())
# add_defaults ()
--- 283,321 ----
standards = [('README', 'README.txt'), self.distribution.script_name]
for fn in standards:
! if type(fn) is TupleType:
alts = fn
got_it = 0
for fn in alts:
! if os.path.exists(fn):
got_it = 1
! self.filelist.append(fn)
break
if not got_it:
! self.warn("standard file not found: should have one of " +
! string.join(alts, ', '))
else:
! if os.path.exists(fn):
! self.filelist.append(fn)
else:
! self.warn("standard file '%s' not found" % fn)
optional = ['test/test*.py', 'setup.cfg']
for pattern in optional:
! files = filter(os.path.isfile, glob(pattern))
if files:
! self.filelist.extend(files)
if self.distribution.has_pure_modules():
! build_py = self.get_finalized_command('build_py')
! self.filelist.extend(build_py.get_source_files())
if self.distribution.has_ext_modules():
! build_ext = self.get_finalized_command('build_ext')
! self.filelist.extend(build_ext.get_source_files())
if self.distribution.has_c_libraries():
! build_clib = self.get_finalized_command('build_clib')
! self.filelist.extend(build_clib.get_source_files())
# add_defaults ()
***************
*** 330,340 ****
"""
self.announce("reading manifest template '%s'" % self.template)
! template = TextFile (self.template,
! strip_comments=1,
! skip_blanks=1,
! join_lines=1,
! lstrip_ws=1,
! rstrip_ws=1,
! collapse_join=1)
while 1:
--- 330,340 ----
"""
self.announce("reading manifest template '%s'" % self.template)
! template = TextFile(self.template,
! strip_comments=1,
! skip_blanks=1,
! join_lines=1,
! lstrip_ws=1,
! rstrip_ws=1,
! collapse_join=1)
while 1:
***************
*** 387,398 ****
"""
self.announce("reading manifest file '%s'" % self.manifest)
! manifest = open (self.manifest)
while 1:
! line = manifest.readline ()
if line == '': # end of file
break
if line[-1] == '\n':
line = line[0:-1]
! self.filelist.append (line)
# read_manifest ()
--- 387,398 ----
"""
self.announce("reading manifest file '%s'" % self.manifest)
! manifest = open(self.manifest)
while 1:
! line = manifest.readline()
if line == '': # end of file
break
if line[-1] == '\n':
line = line[0:-1]
! self.filelist.append(line)
# read_manifest ()
***************
*** 422,426 ****
# we're done making the distribution archives.)
! if hasattr (os, 'link'): # can make hard links on this system
link = 'hard'
msg = "making hard links in %s..." % base_dir
--- 422,426 ----
# we're done making the distribution archives.)
! if hasattr(os, 'link'): # can make hard links on this system
link = 'hard'
msg = "making hard links in %s..." % base_dir
***************
*** 432,442 ****
self.warn("no files to distribute -- empty manifest?")
else:
! self.announce (msg)
for file in files:
if not os.path.isfile(file):
self.warn("'%s' not a regular file -- skipping" % file)
else:
! dest = os.path.join (base_dir, file)
! self.copy_file (file, dest, link=link)
# make_release_tree ()
--- 432,442 ----
self.warn("no files to distribute -- empty manifest?")
else:
! self.announce(msg)
for file in files:
if not os.path.isfile(file):
self.warn("'%s' not a regular file -- skipping" % file)
else:
! dest = os.path.join(base_dir, file)
! self.copy_file(file, dest, link=link)
# make_release_tree ()
***************
*** 456,463 ****
base_name = os.path.join(self.dist_dir, base_dir)
! self.make_release_tree (base_dir, self.filelist.files)
archive_files = [] # remember names of files we create
for fmt in self.formats:
! file = self.make_archive (base_name, fmt, base_dir=base_dir)
archive_files.append(file)
--- 456,463 ----
base_name = os.path.join(self.dist_dir, base_dir)
! self.make_release_tree(base_dir, self.filelist.files)
archive_files = [] # remember names of files we create
for fmt in self.formats:
! file = self.make_archive(base_name, fmt, base_dir=base_dir)
archive_files.append(file)
***************
*** 465,469 ****
if not self.keep_temp:
! dir_util.remove_tree (base_dir, self.verbose, self.dry_run)
def get_archive_files (self):
--- 465,469 ----
if not self.keep_temp:
! dir_util.remove_tree(base_dir, self.verbose, self.dry_run)
def get_archive_files (self):