diff options
author | cookedm <cookedm@localhost> | 2006-07-06 16:57:20 +0000 |
---|---|---|
committer | cookedm <cookedm@localhost> | 2006-07-06 16:57:20 +0000 |
commit | 6782a92fd1a7625ee48f6b2946a7d7149ab28a77 (patch) | |
tree | 177a92f0673655b58b247e663477af06ac1192b6 /command/install.py | |
parent | 216f071ab060a6f08c22666aea33f7095f079d1e (diff) | |
download | numpy-6782a92fd1a7625ee48f6b2946a7d7149ab28a77.tar.gz |
Branch numpy.distutils to distutils-revamp
Diffstat (limited to 'command/install.py')
-rw-r--r-- | command/install.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/command/install.py b/command/install.py new file mode 100644 index 000000000..36e6b5a66 --- /dev/null +++ b/command/install.py @@ -0,0 +1,36 @@ +import sys +if 'setuptools' in sys.modules: + import setuptools.command.install as old_install_mod +else: + import distutils.command.install as old_install_mod +old_install = old_install_mod.install +from distutils.file_util import write_file + +class install(old_install): + + def finalize_options (self): + old_install.finalize_options(self) + self.install_lib = self.install_libbase + + def run(self): + r = old_install.run(self) + if self.record: + # bdist_rpm fails when INSTALLED_FILES contains + # paths with spaces. Such paths must be enclosed + # with double-quotes. + f = open(self.record,'r') + lines = [] + need_rewrite = False + for l in f.readlines(): + l = l.rstrip() + if ' ' in l: + need_rewrite = True + l = '"%s"' % (l) + lines.append(l) + f.close() + if need_rewrite: + self.execute(write_file, + (self.record, lines), + "re-writing list of installed files to '%s'" % + self.record) + return r |