[Python-checkins] python/nondist/sandbox/msi msi.py,1.20,1.21

loewis at users.sourceforge.net loewis at users.sourceforge.net
Sun Aug 1 12:41:20 CEST 2004


Update of /cvsroot/python/python/nondist/sandbox/msi
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29115

Modified Files:
	msi.py 
Log Message:
Extract version from patchlevel.h. Make releases have the same 
ProductVersion as the Python DLL.


Index: msi.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/msi/msi.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** msi.py	1 Aug 2004 10:03:15 -0000	1.20
--- msi.py	1 Aug 2004 10:41:17 -0000	1.21
***************
*** 10,15 ****
  # 1 for Itanium build
  msilib.Win64 = 0
- # Micro version
- current_version = "2.4.0"
  # 0 for beta or final releases;
  # 1 means to use a new product code for each package
--- 10,13 ----
***************
*** 30,35 ****
      pass
  
! major, minor, micro = current_version.split(".")
  short_version = major+"."+minor
  
  # This should never change. The UpgradeCode of this package can be
--- 28,57 ----
      pass
  
! # Extract current version from Include/patchlevel.h
! lines = open(srcdir + "/Include/patchlevel.h").readlines()
! major = minor = micro = level = serial = None
! levels = {
!     'PY_RELEASE_LEVEL_ALPHA':0xA,
!     'PY_RELEASE_LEVEL_BETA': 0xB,
!     'PY_RELEASE_LEVEL_GAMMA':0xC,
!     'PY_RELEASE_LEVEL_FINAL':0xF
!     }
! for l in lines:
!     if not l.startswith("#define"):
!         continue
!     l = l.split()
!     if len(l) != 3:
!         continue
!     _, name, value = l
!     if name == 'PY_MAJOR_VERSION': major = value
!     if name == 'PY_MINOR_VERSION': minor = value
!     if name == 'PY_MICRO_VERSION': micro = value
!     if name == 'PY_RELEASE_LEVEL': level = levels[value]
!     if name == 'PY_RELEASE_SERIAL': serial = value
! 
  short_version = major+"."+minor
+ # See PC/make_versioninfo.c
+ FIELD3 = 1000*int(micro) + 10*level + int(serial)
+ current_version = "%s.%d" % (short_version, FIELD3)
  
  # This should never change. The UpgradeCode of this package can be
***************
*** 48,60 ****
  # so people can refer to them.
  product_codes = {
!     '2.3.2'  : "{3ad0c9ed-7e5e-478c-b539-5cc3a2f8772a}",
!     '2.3.3'  : "{aab605af-d181-4b68-bcb0-6beb32f32844}",
!     '2.4.0': "{93792a5a-5bb0-43b1-904f-ba10c4f08ec8}",
  }
- product_code = product_codes[current_version]
  
  if snapshot:
!     release = int(time.time()/3600/24)
      product_code = msilib.gen_uuid()
  
  extensions = [
--- 70,91 ----
  # so people can refer to them.
  product_codes = {
!     '2.4.101': '{0e9b4d8e-6cda-446e-a208-7b92f3ddffa0}', # 2.4a1, released as a snapshot
!     '2.4.102': '{1b998745-4901-4edb-bc52-213689e1b922}', # 2.4a2
!     '2.4.103': '{33fc8bd2-1e8f-4add-a40a-ade2728d5942}', # 2.4a3
!     '2.4.111': '{51a7e2a8-2025-4ef0-86ff-e6aab742d1fa}', # 2.4b1
!     '2.4.112': '{4a5e7c1d-c659-4fe3-b8c9-7c65bd9c95a5}', # 2.4b2
!     '2.4.121': '{75508821-a8e9-40a8-95bd-dbe6033ddbea}', # 2.4c1
!     '2.4.122': '{83a9118b-4bdd-473b-afc3-bcb142feca9e}', # 2.4c2
!     '2.4.150': '{82d9302e-f209-4805-b548-52087047483a}', # 2.4.0
  }
  
  if snapshot:
!     current_version = "%s.%s.%s" % (major, minor, int(time.time()/3600/24))
      product_code = msilib.gen_uuid()
+ else:
+     product_code = product_codes[current_version]
+ 
+ if full_current_version is None:
+     full_current_version = current_version
  
  extensions = [
***************
*** 83,92 ****
      ])
  
- if full_current_version is None:
-     if snapshot:
-         full_current_version = "%s.%d" % (current_version, release)
-     else:
-         full_current_version = current_version
- 
  if testpackage:
      ext = 'px'
--- 114,117 ----
***************
*** 107,114 ****
      Summary information stream."""
      if snapshot:
-         cv = "%s.%s.%s" % (major, minor, release)
          uc = upgrade_code_snapshot
      else:
-         cv = current_version
          uc = upgrade_code
      # schema represents the installer 2.0 database schema.
--- 132,137 ----
***************
*** 118,122 ****
                            ProductName="Python "+full_current_version,
                    ProductCode=product_code,
!                   ProductVersion=cv,
                    Manufacturer=u"Martin v. L\xf6wis")
      msilib.add_tables(db, sequence)
--- 141,145 ----
                            ProductName="Python "+full_current_version,
                    ProductCode=product_code,
!                   ProductVersion=current_version,
                    Manufacturer=u"Martin v. L\xf6wis")
      msilib.add_tables(db, sequence)
***************
*** 146,150 ****
          add_data(db, "Upgrade",
              [(upgrade_code_snapshot, start,  
!               "%s.%s.%s" % (major, minor, release),
                None,                     # Ignore language
                migrate_features, 
--- 169,173 ----
          add_data(db, "Upgrade",
              [(upgrade_code_snapshot, start,  
!               current_version,
                None,                     # Ignore language
                migrate_features, 
***************
*** 702,707 ****
      dlldir.start_component("DLLDIR", flags = 8, keyfile = pydll)
      installer = msilib.MakeInstaller()
      dlldir.add_file("PCBuild/python%s%s.dll" % (major, minor),
!                     version=installer.FileVersion(pydllsrc, 0),
                      language=installer.FileVersion(pydllsrc, 1))
      # XXX determine dependencies
--- 725,735 ----
      dlldir.start_component("DLLDIR", flags = 8, keyfile = pydll)
      installer = msilib.MakeInstaller()
+     pyversion = installer.FileVersion(pydllsrc, 0)
+     if not snapshot:
+         # For releases, the Python DLL has the same version as the
+         # installer package.
+         assert pyversion == current_version
      dlldir.add_file("PCBuild/python%s%s.dll" % (major, minor),
!                     version=pyversion,
                      language=installer.FileVersion(pydllsrc, 1))
      # XXX determine dependencies



More information about the Python-checkins mailing list