[Python-3000-checkins] r63889 - in python/branches/py3k: Tools/msi/msi.py Tools/msi/msilib.py

martin.v.loewis python-3000-checkins at python.org
Tue Jun 3 20:57:08 CEST 2008


Author: martin.v.loewis
Date: Mon Jun  2 12:04:16 2008
New Revision: 63889

Log:
Merged revisions 63625-63629,63631-63633,63635-63638 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r63625 | martin.v.loewis | 2008-05-25 13:56:23 +0200 (So, 25 Mai 2008) | 1 line
  
  Include all licenses of the packages that we include.
........
  r63638 | martin.v.loewis | 2008-05-25 18:37:34 +0200 (So, 25 Mai 2008) | 1 line
  
  Create grammar pickle files on installation; remove them on uninstallation.
........


Modified:
   python/branches/py3k/   (props changed)
   python/branches/py3k/Tools/msi/msi.py
   python/branches/py3k/Tools/msi/msilib.py

Modified: python/branches/py3k/Tools/msi/msi.py
==============================================================================
--- python/branches/py3k/Tools/msi/msi.py	(original)
+++ python/branches/py3k/Tools/msi/msi.py	Mon Jun  2 12:04:16 2008
@@ -383,6 +383,7 @@
              ])
 
     compileargs = r'-Wi "[TARGETDIR]Lib\compileall.py" -f -x bad_coding|badsyntax|site-packages|py2_ "[TARGETDIR]Lib"'
+    lib2to3args = r'-c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"'
     # See "CustomAction Table"
     add_data(db, "CustomAction", [
         # msidbCustomActionTypeFirstSequence + msidbCustomActionTypeTextData + msidbCustomActionTypeProperty
@@ -396,6 +397,7 @@
         # See "Custom Action Type 18"
         ("CompilePyc", 18, "python.exe", compileargs),
         ("CompilePyo", 18, "python.exe", "-O "+compileargs),
+        ("CompileGrammar", 18, "python.exe", lib2to3args),
         ])
 
     # UI Sequences, see "InstallUISequence Table", "Using a Sequence Table"
@@ -425,12 +427,14 @@
              ("UpdateEditIDLE", None, 1050),
              ("CompilePyc", "COMPILEALL", 6800),
              ("CompilePyo", "COMPILEALL", 6801),
+             ("CompileGrammar", "COMPILEALL", 6802),
             ])
     add_data(db, "AdminExecuteSequence",
             [("InitialTargetDir", 'TARGETDIR=""', 750),
              ("SetDLLDirToTarget", 'DLLDIR=""', 751),
              ("CompilePyc", "COMPILEALL", 6800),
              ("CompilePyo", "COMPILEALL", 6801),
+             ("CompileGrammar", "COMPILEALL", 6802),
             ])
 
     #####################################################################
@@ -841,6 +845,26 @@
         result.append((f, kw))
     return result
 
+def generate_license():
+    import shutil, glob
+    out = open("LICENSE.txt", "w")
+    shutil.copyfileobj(open(os.path.join(srcdir, "LICENSE")), out)
+    for dir, file in (("bzip2","LICENSE"),
+                      ("db", "LICENSE"),
+                      ("openssl", "LICENSE"),
+                      ("tcl", "license.terms"),
+                      ("tk", "license.terms")):
+        out.write("\nThis copy of Python includes a copy of %s, which is licensed under the following terms:\n\n" % dir)
+        dirs = glob.glob(srcdir+"/../"+dir+"-*")
+        if not dirs:
+            raise ValueError, "Could not find "+srcdir+"/../"+dir+"-*"
+        if len(dirs) > 2:
+            raise ValueError, "Multiple copies of "+dir
+        dir = dirs[0]
+        shutil.copyfileobj(open(os.path.join(dir, file)), out)
+    out.close()
+
+
 class PyDirectory(Directory):
     """By default, all components in the Python installer
     can run from source."""
@@ -861,7 +885,8 @@
         root.add_file("%s/w9xpopen.exe" % PCBUILD)
     root.add_file("README.txt", src="README")
     root.add_file("NEWS.txt", src="Misc/NEWS")
-    root.add_file("LICENSE.txt", src="LICENSE")
+    generate_license()
+    root.add_file("LICENSE.txt", src=os.path.abspath("LICENSE.txt"))
     root.start_component("python.exe", keyfile="python.exe")
     root.add_file("%s/python.exe" % PCBUILD)
     root.start_component("pythonw.exe", keyfile="pythonw.exe")
@@ -979,6 +1004,8 @@
         if dir=="setuptools":
             lib.add_file("cli.exe")
             lib.add_file("gui.exe")
+        if dir=="lib2to3":
+            lib.removefile("pickle", "*.pickle")
         if dir=="data" and parent.physical=="test" and parent.basedir.physical=="email":
             # This should contain all non-.svn files listed in subversion
             for f in os.listdir(lib.absolute):

Modified: python/branches/py3k/Tools/msi/msilib.py
==============================================================================
--- python/branches/py3k/Tools/msi/msilib.py	(original)
+++ python/branches/py3k/Tools/msi/msilib.py	Mon Jun  2 12:04:16 2008
@@ -566,6 +566,11 @@
                  [(self.component+"c", self.component, "*.pyc", self.logical, 2),
                   (self.component+"o", self.component, "*.pyo", self.logical, 2)])
 
+    def removefile(self, key, pattern):
+        "Add a RemoveFile entry"
+        add_data(self.db, "RemoveFile", [(self.component+key, self.component, pattern, self.logical, 2)])
+
+
 class Feature:
     def __init__(self, db, id, title, desc, display, level = 1,
                  parent=None, directory = None, attributes=0):


More information about the Python-3000-checkins mailing list