[Python-checkins] cpython: Generate product code UUID from download URL.

martin.v.loewis python-checkins at python.org
Sun Mar 4 20:13:00 CET 2012


http://hg.python.org/cpython/rev/8d5796c8325e
changeset: 75393:8d5796c8325e
parent: 75391:f7a9a10ae0c0
user: Martin v. Löwis <martin at v.loewis.de>
date: Sun Mar 04 19:48:25 2012 +0100
summary:
 Generate product code UUID from download URL.
files:
 Tools/msi/msi.py | 19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/Tools/msi/msi.py b/Tools/msi/msi.py
--- a/Tools/msi/msi.py
+++ b/Tools/msi/msi.py
@@ -6,7 +6,6 @@
 import uisample
 from win32com.client import constants
 from distutils.spawn import find_executable
-from uuids import product_codes
 import tempfile
 
 # Settings can be overridden in config.py below
@@ -77,9 +76,6 @@
 
 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
@@ -187,12 +183,19 @@
 msilib.set_arch_from_file(dll_path)
 if msilib.pe_type(dll_path) != msilib.pe_type("msisupport.dll"):
 raise SystemError("msisupport.dll for incorrect architecture")
+
 if msilib.Win64:
 upgrade_code = upgrade_code_64
- # Bump the last digit of the code by one, so that 32-bit and 64-bit
- # releases get separate product codes
- digit = hex((int(product_code[-2],16)+1)%16)[-1]
- product_code = product_code[:-2] + digit + '}'
+
+if snapshot:
+ product_code = msilib.gen_uuid()
+else:
+ # official release: generate UUID from the download link that the file will have
+ import uuid
+ product_code = uuid.uuid3(uuid.NAMESPACE_URL,
+ 'http://www.python.org/ftp/python/%s.%s.%s/python-%s%s.msi' %
+ (major, minor, micro, full_current_version, msilib.arch_ext))
+ product_code = '{%s}' % product_code
 
 if testpackage:
 ext = 'px'
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /