aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/bdist_wininst.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-05-03 23:09:46 -0400
committerJason R. Coombs <jaraco@jaraco.com>2013-05-03 23:09:46 -0400
commitff75a6cbdbcde8d9e3b979c30c3d6e64a1bc5374 (patch)
tree6bc72488f8f69a175fcfd3540f0a3ac701b244f5 /setuptools/command/bdist_wininst.py
parentb33cf3e333837cf2fa04af79bcd46094a047741b (diff)
downloadexternal_python_setuptools-ff75a6cbdbcde8d9e3b979c30c3d6e64a1bc5374.tar.gz
external_python_setuptools-ff75a6cbdbcde8d9e3b979c30c3d6e64a1bc5374.tar.bz2
external_python_setuptools-ff75a6cbdbcde8d9e3b979c30c3d6e64a1bc5374.zip
Copy changes from 1aae1efe5733 for setuptools/command/* (except easy_install.py
--HG-- branch : Setuptools-Distribute merge extra : source : 0c89fbb19c269ce1cb3bc3e9ece9864127768169
Diffstat (limited to 'setuptools/command/bdist_wininst.py')
-rwxr-xr-xsetuptools/command/bdist_wininst.py67
1 files changed, 54 insertions, 13 deletions
diff --git a/setuptools/command/bdist_wininst.py b/setuptools/command/bdist_wininst.py
index 93e6846d..e8521f83 100755
--- a/setuptools/command/bdist_wininst.py
+++ b/setuptools/command/bdist_wininst.py
@@ -2,26 +2,24 @@ from distutils.command.bdist_wininst import bdist_wininst as _bdist_wininst
import os, sys
class bdist_wininst(_bdist_wininst):
+ _good_upload = _bad_upload = None
def create_exe(self, arcname, fullname, bitmap=None):
_bdist_wininst.create_exe(self, arcname, fullname, bitmap)
- dist_files = getattr(self.distribution, 'dist_files', [])
-
+ installer_name = self.get_installer_filename(fullname)
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)
+ # fix 2.5+ bdist_wininst ignoring --target-version spec
+ self._bad_upload = ('bdist_wininst', 'any', installer_name)
else:
- installer_name = os.path.join(self.dist_dir,
- "%s.win32.exe" % fullname)
pyversion = 'any'
- good = ('bdist_wininst', pyversion, installer_name)
+ self._good_upload = ('bdist_wininst', pyversion, installer_name)
+
+ def _fix_upload_names(self):
+ good, bad = self._good_upload, self._bad_upload
+ dist_files = getattr(self.distribution, 'dist_files', [])
+ if bad in dist_files:
+ dist_files.remove(bad)
if good not in dist_files:
dist_files.append(good)
@@ -36,6 +34,49 @@ class bdist_wininst(_bdist_wininst):
self._is_running = True
try:
_bdist_wininst.run(self)
+ self._fix_upload_names()
finally:
self._is_running = False
+
+ if not hasattr(_bdist_wininst, 'get_installer_filename'):
+ def get_installer_filename(self, fullname):
+ # Factored out to allow overriding in subclasses
+ if self.target_version:
+ # if we create an installer for a specific python version,
+ # it's better to include this in the name
+ installer_name = os.path.join(self.dist_dir,
+ "%s.win32-py%s.exe" %
+ (fullname, self.target_version))
+ else:
+ installer_name = os.path.join(self.dist_dir,
+ "%s.win32.exe" % fullname)
+ return installer_name
+ # get_installer_filename()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+