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.
........
This commit is contained in:
Martin v. Löwis 2008-06-02 10:04:16 +00:00
parent 4a8d47e714
commit 90cc5ab976
2 changed files with 33 additions and 1 deletions

View File

@ -383,6 +383,7 @@ def add_ui(db):
])
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 @@ def add_ui(db):
# 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 @@ def add_ui(db):
("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 @@ def extract_msvcr90():
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 @@ def add_files(db):
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 @@ def add_files(db):
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):

View File

@ -566,6 +566,11 @@ class Directory:
[(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):