diff -c -r --ignore-all-space --exclude=*.pyc -N distutils.orig/distutils/cmd.py distutils.patched/distutils/cmd.py *** distutils.orig/distutils/cmd.py Sun Apr 16 00:15:07 2000 --- distutils.patched/distutils/cmd.py Thu Apr 27 15:36:30 2000 *************** *** 384,389 **** --- 384,416 ---- # class Command + class install_misc(Command): + """Common base class for installing some files in a subdirectory + Currently used by install_data and install_scripts + """ + user_options = [('install-dir=', 'd', "directory to install the files to")] + + def initialize_options (self): + self.install_dir = None + self.outfiles = None + + def _install_dir_from(self, dirname): + self.set_undefined_options('install', (dirname, 'install_dir')) + + def _copydata(self, filelist): + self.outfiles = [] + if not filelist: + return + self.mkpath(self.install_dir) + for f in filelist: + self.outfiles.append(self.copy_file (f, self.install_dir)) + + def _outputdata(self, filelist): + if self.outfiles is not None: + return self.outfiles + return map(lambda x: os.path.join(self.install_dir, x), filelist) + + if __name__ == "__main__": print "ok" diff -c -r --ignore-all-space --exclude=*.pyc -N distutils.orig/distutils/command/__init__.py distutils.patched/distutils/command/__init__.py *** distutils.orig/distutils/command/__init__.py Fri Mar 31 05:14:51 2000 --- distutils.patched/distutils/command/__init__.py Thu Apr 27 15:37:11 2000 *************** *** 11,16 **** --- 11,18 ---- 'build_clib', 'install', 'install_lib', + 'install_scripts', + 'install_data', 'clean', 'sdist', 'bdist', diff -c -r --ignore-all-space --exclude=*.pyc -N distutils.orig/distutils/command/install.py distutils.patched/distutils/command/install.py *** distutils.orig/distutils/command/install.py Thu Apr 27 03:56:38 2000 --- distutils.patched/distutils/command/install.py Thu Apr 27 15:55:04 2000 *************** *** 90,96 **** # (func, command) where 'func' is a function to call that returns # true if 'command' (the sub-command name, a string) needs to be # run. If 'func' is None, assume that 'command' must always be run. ! sub_commands = [(None, 'install_lib')] def initialize_options (self): --- 90,99 ---- # (func, command) where 'func' is a function to call that returns # true if 'command' (the sub-command name, a string) needs to be # run. If 'func' is None, assume that 'command' must always be run. ! sub_commands = [(None, 'install_lib'), ! (None, 'install_scripts'), ! (None, 'install_data'), ! ] def initialize_options (self): diff -c -r --ignore-all-space --exclude=*.pyc -N distutils.orig/distutils/command/install_data.py distutils.patched/distutils/command/install_data.py *** distutils.orig/distutils/command/install_data.py Thu Jan 1 01:00:00 1970 --- distutils.patched/distutils/command/install_data.py Thu Apr 27 15:35:45 2000 *************** *** 0 **** --- 1,14 ---- + from distutils.cmd import install_misc + + class install_data (install_misc): + + description = "install data files" + + def finalize_options (self): + self._install_dir_from('install_data') + + def run (self): + self._copydata(self.distribution.data) + + def get_outputs(self): + return self._outputdata(self.distribution.data) diff -c -r --ignore-all-space --exclude=*.pyc -N distutils.orig/distutils/command/install_scripts.py distutils.patched/distutils/command/install_scripts.py *** distutils.orig/distutils/command/install_scripts.py Thu Jan 1 01:00:00 1970 --- distutils.patched/distutils/command/install_scripts.py Thu Apr 27 15:35:40 2000 *************** *** 0 **** --- 1,15 ---- + from distutils.cmd import install_misc + + class install_scripts(install_misc): + + description = "install scripts" + user_options = [('install-dir=', 'd', "directory to install to")] + + def finalize_options (self): + self._install_dir_from('install_scripts') + + def run (self): + self._copydata(self.distribution.scripts) + + def get_outputs(self): + return self._outputdata(self.distribution.scripts) diff -c -r --ignore-all-space --exclude=*.pyc -N distutils.orig/distutils/dist.py distutils.patched/distutils/dist.py *** distutils.orig/distutils/dist.py Wed Apr 26 04:26:55 2000 --- distutils.patched/distutils/dist.py Thu Apr 27 15:54:06 2000 *************** *** 148,153 **** --- 148,155 ---- self.ext_package = None self.include_dirs = None self.extra_path = None + self.scripts = None + self.data = None # And now initialize bookkeeping stuff that can't be supplied by # the caller at all. 'command_obj' maps command names to diff -c -r --ignore-all-space --exclude=*.pyc -N distutils.orig/doc/dist/dist.tex distutils.patched/doc/dist/dist.tex *** distutils.orig/doc/dist/dist.tex Tue Apr 25 04:57:36 2000 --- distutils.patched/doc/dist/dist.tex Thu Apr 27 15:51:50 2000 *************** *** 652,657 **** --- 652,672 ---- \subsection{Installing modules: the \protect\command{install} command family} \label{sec:install-cmd} + The install command ensures that the build commands have been run and then + runs the subcommands \command{install\_lib}, + \command{install\_data} and + \command{install\_scripts}. + + \subsubsection{\protect\command{install\_lib}} + \label{sec:install-lib-cmd} + + \subsubsection{\protect\command{install\_data}} + \label{sec:install-data-cmd} + This command installs all data files of the distribution. + + \subsubsection{\protect\command{install\_scripts}} + \label{sec:install-scripts-cmd} + This command installs all script files of the distribution. \subsection{Cleaning up: the \protect\command{clean} command}