[Python-checkins] CVS: distutils/distutils/command bdist_wininst.py,1.3,1.4

Greg Ward python-dev@python.org
Tue, 4 Jul 2000 20:08:57 -0700


Update of /cvsroot/python/distutils/distutils/command
In directory slayer.i.sourceforge.net:/tmp/cvs-serv16999/command

Modified Files:
	bdist_wininst.py 
Log Message:
Fixed so the ZIP file (which is bundled into an executable) goes in the
  temporary directory ('bdist_base').
Added --dist-dir option to control where the executable is put.

Index: bdist_wininst.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/command/bdist_wininst.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** bdist_wininst.py	2000/06/29 23:50:19	1.3
--- bdist_wininst.py	2000/07/05 03:08:55	1.4
***************
*** 29,32 ****
--- 29,34 ----
                       "require a specific python version" +
                       " on the target system (1.5 or 1.6/2.0)"),
+                     ('dist-dir=', 'd',
+                      "directory to put final built distributions in"),
                     ]
  
***************
*** 37,40 ****
--- 39,43 ----
          self.target_optimize = 0
          self.target_version = None
+         self.dist_dir = None
  
      # initialize_options()
***************
*** 58,61 ****
--- 61,66 ----
              self.target_version = short_version
  
+         self.set_undefined_options('bdist', ('dist_dir', 'dist_dir'))
+ 
      # finalize_options()
  
***************
*** 93,97 ****
          # And make an archive relative to the root of the
          # pseudo-installation tree.
!         archive_basename = "%s.win32" % self.distribution.get_fullname()
          # XXX hack! Our archive MUST be relative to sys.prefix
          # XXX What about .install_data, .install_scripts, ...?
--- 98,105 ----
          # And make an archive relative to the root of the
          # pseudo-installation tree.
!         fullname = self.distribution.get_fullname()
!         archive_basename = os.path.join(self.bdist_dir,
!                                         "%s.win32" % fullname)
! 
          # XXX hack! Our archive MUST be relative to sys.prefix
          # XXX What about .install_data, .install_scripts, ...?
***************
*** 104,108 ****
          arcname = self.make_archive (archive_basename, "zip",
                                       root_dir=root_dir)
!         self.create_exe (arcname)
  
          if not self.keep_tree:
--- 112,116 ----
          arcname = self.make_archive (archive_basename, "zip",
                                       root_dir=root_dir)
!         self.create_exe (arcname, fullname)
  
          if not self.keep_tree:
***************
*** 157,161 ****
      # create_inifile()
  
!     def create_exe (self, arcname):
          import struct, zlib
  
--- 165,169 ----
      # create_inifile()
  
!     def create_exe (self, arcname, fullname):
          import struct, zlib
  
***************
*** 166,170 ****
          zcfgdata = co.compress (cfgdata) + co.flush()
  
!         installer_name = "%s.win32.exe" % self.distribution.get_fullname()
          self.announce ("creating %s" % installer_name)
  
--- 174,179 ----
          zcfgdata = co.compress (cfgdata) + co.flush()
  
!         installer_name = os.path.join(self.dist_dir,
!                                       "%s.win32.exe" % fullname)
          self.announce ("creating %s" % installer_name)