diff options
author | PJ Eby <distutils-sig@python.org> | 2007-01-09 19:28:05 +0000 |
---|---|---|
committer | PJ Eby <distutils-sig@python.org> | 2007-01-09 19:28:05 +0000 |
commit | e4b870ffeca16e2a000793a1e5515ad559d0ddfc (patch) | |
tree | e78b256a99e3e4203da4e16154963e1e38b47efd /setuptools/command/bdist_wininst.py | |
parent | e75740baecd2096b927d8c30264e5da8f9bb0936 (diff) | |
download | external_python_setuptools-e4b870ffeca16e2a000793a1e5515ad559d0ddfc.tar.gz external_python_setuptools-e4b870ffeca16e2a000793a1e5515ad559d0ddfc.tar.bz2 external_python_setuptools-e4b870ffeca16e2a000793a1e5515ad559d0ddfc.zip |
Fix uploaded ``bdist_wininst`` packages being described as suitable for
"any" version by Python 2.5, even if a ``--target-version`` was
specified. (backport from trunk)
--HG--
branch : setuptools-0.6
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4053319
Diffstat (limited to 'setuptools/command/bdist_wininst.py')
-rwxr-xr-x | setuptools/command/bdist_wininst.py | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/setuptools/command/bdist_wininst.py b/setuptools/command/bdist_wininst.py index 2dcc48ca..0d70ff71 100755 --- a/setuptools/command/bdist_wininst.py +++ b/setuptools/command/bdist_wininst.py @@ -2,24 +2,27 @@ from distutils.command.bdist_wininst import bdist_wininst as _bdist_wininst import os, sys class bdist_wininst(_bdist_wininst): - if sys.version<'2.5': - def create_exe(self, arcname, fullname, bitmap=None): - - _bdist_wininst.create_exe(self, arcname, fullname, bitmap) - - if self.target_version: - installer_name = os.path.join(self.dist_dir, - "%s.win32-py%s.exe" % - (fullname, self.target_version)) - pyversion = self.target_version - else: - installer_name = os.path.join(self.dist_dir, - "%s.win32.exe" % fullname) - pyversion = 'any' - - getattr(self.distribution,'dist_files',[]).append( - ('bdist_wininst', pyversion, installer_name) - ) + + def create_exe(self, arcname, fullname, bitmap=None): + _bdist_wininst.create_exe(self, arcname, fullname, bitmap) + dist_files = getattr(self.distribution, 'dist_files', []) + + if self.target_version: + installer_name = os.path.join(self.dist_dir, + "%s.win32-py%s.exe" % + (fullname, self.target_version)) + pyversion = self.target_version + + # fix 2.5 bdist_wininst ignoring --target-version spec + bad = ('bdist_wininst','any',installer_name) + if bad in dist_files: + dist_files.remove(bad) + else: + installer_name = os.path.join(self.dist_dir, + "%s.win32.exe" % fullname) + pyversion = 'any' + + dist_files.append(('bdist_wininst', pyversion, installer_name)) def reinitialize_command (self, command, reinit_subcommands=0): cmd = self.distribution.reinitialize_command( |