Index: MANIFEST.in =================================================================== RCS file: /projects/cvsroot/distutils/MANIFEST.in,v retrieving revision 1.4 diff -u -r1.4 MANIFEST.in --- MANIFEST.in 2000/04/21 04:38:11 1.4 +++ MANIFEST.in 2000/05/11 05:41:52 @@ -9,6 +9,7 @@ # include *.txt +include package_data include MANIFEST.in recursive-include examples *.txt *.py prune examples/sample?/build Index: distutils/command/__init__.py =================================================================== RCS file: /projects/cvsroot/distutils/distutils/command/__init__.py,v retrieving revision 1.8 diff -u -r1.8 __init__.py --- __init__.py 2000/03/31 03:14:51 1.8 +++ __init__.py 2000/05/11 05:41:52 @@ -15,4 +15,5 @@ 'sdist', 'bdist', 'bdist_dumb', + 'bdist_rpm', ] Index: distutils/command/bdist.py =================================================================== RCS file: /projects/cvsroot/distutils/distutils/command/bdist.py,v retrieving revision 1.6 diff -u -r1.6 bdist.py --- bdist.py 2000/05/07 15:32:12 1.6 +++ bdist.py 2000/05/11 05:41:53 @@ -22,6 +22,9 @@ "(tar, ztar, gztar, bztar, zip, ... )"), ] + # The following commands do not take a format option from bdist + no_format_option = ( 'bdist_rpm', ) + # This won't do in reality: will need to distinguish RPM-ish Linux, # Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS. default_format = { 'posix': 'gztar', @@ -31,6 +34,7 @@ 'bztar': 'bdist_dumb', 'ztar': 'bdist_dumb', 'tar': 'bdist_dumb', + 'rpm': 'bdist_rpm', 'zip': 'bdist_dumb', } @@ -63,8 +67,9 @@ raise DistutilsOptionError, \ "invalid archive format '%s'" % self.format - sub_cmd = self.find_peer (cmd_name) - sub_cmd.format = self.format + if cmd_name not in self.no_format_option: + sub_cmd = self.find_peer (cmd_name) + sub_cmd.format = self.format self.run_peer (cmd_name) # run() Index: distutils/command/build_ext.py =================================================================== RCS file: /projects/cvsroot/distutils/distutils/command/build_ext.py,v retrieving revision 1.34 diff -u -r1.34 build_ext.py --- build_ext.py 2000/05/09 01:50:41 1.34 +++ build_ext.py 2000/05/11 05:41:56 @@ -9,6 +9,7 @@ __revision__ = "$Id: build_ext.py,v 1.34 2000/05/09 01:50:41 gward Exp $" import sys, os, string, re +from string import split from types import * from distutils.core import Command from distutils.errors import * @@ -290,6 +291,11 @@ macros = build_info.get ('macros') include_dirs = build_info.get ('include_dirs') extra_args = build_info.get ('extra_compile_args') + # honor CFLAGS enviroment variable + if os.environ.has_key('CFLAGS'): + if not extra_args: + extra_args = [] + extra_args = split(os.environ['CFLAGS']) + extra_args objects = self.compiler.compile (sources, output_dir=self.build_temp, macros=macros, Index: distutils/command/clean.py =================================================================== RCS file: /projects/cvsroot/distutils/distutils/command/clean.py,v retrieving revision 1.2 diff -u -r1.2 clean.py --- clean.py 2000/03/18 17:33:18 1.2 +++ clean.py 2000/05/11 05:41:56 @@ -53,6 +53,10 @@ # remove the module build directory (unless already gone) if os.path.exists (self.build_lib): remove_tree (self.build_lib, self.verbose, self.dry_run) + # remove build/rpm (note: RPM handles cleaning up of temporary + # builds itself + if os.path.exists ('build/rpm'): + remove_tree ('build/rpm', self.verbose, self.dry_run) # just for the heck of it, try to remove the base build directory: # we might have emptied it right now, but if not we don't care Index: distutils/command/install.py =================================================================== RCS file: /projects/cvsroot/distutils/distutils/command/install.py,v retrieving revision 1.23 diff -u -r1.23 install.py --- install.py 2000/04/27 01:56:38 1.23 +++ install.py 2000/05/11 05:42:01 @@ -12,6 +12,7 @@ from distutils import sysconfig from distutils.util import write_file, native_path, subst_vars, change_root from distutils.errors import DistutilsOptionError +from glob import glob INSTALL_SCHEMES = { 'unix_prefix': { @@ -82,8 +83,10 @@ #('install-man=', None, "directory for Unix man pages"), #('install-html=', None, "directory for HTML documentation"), #('install-info=', None, "directory for GNU info files"), - ] + ('record', None, + "make a record of installation"), + ] # 'sub_commands': a list of commands this command might have to run # to get its work done. Each command is represented as a tuple @@ -141,6 +144,7 @@ #self.install_html = None #self.install_info = None + self.record = None def finalize_options (self): @@ -267,7 +271,8 @@ from distutils.fancy_getopt import longopt_xlate print msg + ":" for opt in self.user_options: - opt_name = string.translate (opt[0][0:-1], longopt_xlate) + if opt[0][-1] == '=': + opt_name = string.translate (opt[0][0:-1], longopt_xlate) val = getattr (self, opt_name) print " %s: %s" % (opt_name, val) @@ -424,6 +429,22 @@ "Python's module search path (sys.path) -- " + "you'll have to change the search path yourself") % self.install_lib) + + # write list of installed files, if requested. + if self.record: + outputs = self.get_outputs() + for counter in xrange (len (outputs)): # include ".pyc" and ".pyo" + if outputs[counter][-3:] == ".py": + byte_code = glob(outputs[counter] + '[co]') + outputs.extend(byte_code) + outputs.sort() # just makes it look nicer + 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, + ("INSTALLED_FILES", outputs), + "Writing list of installed files") # run () Index: distutils/command/sdist.py =================================================================== RCS file: /projects/cvsroot/distutils/distutils/command/sdist.py,v retrieving revision 1.18 diff -u -r1.18 sdist.py --- sdist.py 2000/04/26 01:14:33 1.18 +++ sdist.py 2000/05/11 05:42:06 @@ -196,7 +196,7 @@ def find_defaults (self): - standards = [('README', 'README.txt'), 'setup.py'] + standards = [('README', 'README.txt'), 'setup.py', 'package_data'] for fn in standards: if type (fn) is TupleType: alts = fn