Commits

Anonymous committed 33462a1

Fix bdist_wininst files not being uploaded by "upload"
(backport from trunk)

  • Participants
  • Parent commits 69e4aa5
  • Branches setuptools-0.6

Comments (0)

Files changed (3)

File setuptools.txt

 ----------------------------
 
 0.6c4
- * Fix ``upload`` not uploading files built by ``bdist_rpm`` on Python 2.3 and
-   2.4.
+ * Fix ``upload`` command not uploading files built by ``bdist_rpm`` or
+   ``bdist_wininst`` under Python 2.3 and 2.4.
 
 0.6c3
  * Fixed breakages caused by Subversion 1.4's new "working copy" format

File setuptools/command/__init__.py

     'alias', 'bdist_egg', 'bdist_rpm', 'build_ext', 'build_py', 'develop',
     'easy_install', 'egg_info', 'install', 'install_lib', 'rotate', 'saveopts',
     'sdist', 'setopt', 'test', 'upload', 'install_egg_info', 'install_scripts',
-    'register',
+    'register', 'bdist_wininst',
 ]
 
 import sys
 if sys.version>='2.5':
     # In Python 2.5 and above, distutils includes its own upload command
     __all__.remove('upload')
+    __all__.remove('bdist_wininst')  # this is only for 'upload' support
 
 from distutils.command.bdist import bdist
 

File setuptools/command/bdist_wininst.py

+from distutils.command.bdist_wininst import bdist_wininst as _bdist_wininst
+import sys
+
+class bdist_wininst(_bdist_wininst):
+
+    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)
+        )