Commit e4b870ff authored by PJ Eby's avatar PJ Eby

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
parent e75740ba
......@@ -2604,8 +2604,10 @@ Release Notes/Change History
* Fix uploaded ``bdist_rpm`` packages being described as ``bdist_egg``
packages under Python versions less than 2.5.
0.6c4
* Fix uploaded ``bdist_wininst`` packages being described as suitable for
"any" version by Python 2.5, even if a ``--target-version`` was specified.
0.6c4
* Overhauled Windows script wrapping to support ``bdist_wininst`` better.
Scripts installed with ``bdist_wininst`` will always use ``#!python.exe`` or
``#!pythonw.exe`` as the executable name (even when built on non-Windows
......
......@@ -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(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment