diff options
author | Pearu Peterson <pearu.peterson@gmail.com> | 2006-01-28 09:25:27 +0000 |
---|---|---|
committer | Pearu Peterson <pearu.peterson@gmail.com> | 2006-01-28 09:25:27 +0000 |
commit | ba6c2ba95f4d0ab8a6c153a617aa5d1c789318a5 (patch) | |
tree | 55a2287156f671de104ecd81311868d4c4672a04 /numpy/distutils/command/install.py | |
parent | b8e4a5f019da3020939407e447b0631db5e17371 (diff) | |
download | numpy-ba6c2ba95f4d0ab8a6c153a617aa5d1c789318a5.tar.gz |
Fix bdist_rpm for path names containing spaces.
Diffstat (limited to 'numpy/distutils/command/install.py')
-rw-r--r-- | numpy/distutils/command/install.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/numpy/distutils/command/install.py b/numpy/distutils/command/install.py index 64d613569..f48895b39 100644 --- a/numpy/distutils/command/install.py +++ b/numpy/distutils/command/install.py @@ -1,9 +1,34 @@ +import os from distutils.command.install import * from distutils.command.install import install as old_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 |