[Python-checkins] python/nondist/sandbox/msi msi.py, 1.28,
1.29 msilib.py, 1.11, 1.12
loewis at users.sourceforge.net
loewis at users.sourceforge.net
Tue Aug 17 13:52:04 CEST 2004
Update of /cvsroot/python/python/nondist/sandbox/msi
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3341
Modified Files:
msi.py msilib.py
Log Message:
Add "run from source" option to all components.
Index: msi.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/msi/msi.py,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** msi.py 16 Aug 2004 09:08:38 -0000 1.28
--- msi.py 17 Aug 2004 11:51:51 -0000 1.29
***************
*** 726,729 ****
--- 726,737 ----
installer.FileVersion("msvcr71.dll", 1)
+ class PyDirectory(Directory):
+ """By default, all components in the Python installer
+ can run from source."""
+ def __init__(self, *args, **kw):
+ if not kw.has_key("componentflags"):
+ kw['componentflags'] = 2 #msidbComponentAttributesOptional
+ Directory.__init__(self, *args, **kw)
+
# See "File Table", "Component Table", "Directory Table",
# "FeatureComponents Table"
***************
*** 732,736 ****
tmpfiles = []
# Add all executables, icons, text files into the TARGETDIR component
! root = Directory(db, cab, None, srcdir, "TARGETDIR", "SourceDir")
default_feature.set_current()
root.add_file("PCBuild/w9xpopen.exe")
--- 740,744 ----
tmpfiles = []
# Add all executables, icons, text files into the TARGETDIR component
! root = PyDirectory(db, cab, None, srcdir, "TARGETDIR", "SourceDir")
default_feature.set_current()
root.add_file("PCBuild/w9xpopen.exe")
***************
*** 746,750 ****
# msidbComponentAttributesSharedDllRefCount = 8, see "Component Table"
! dlldir = Directory(db, cab, root, srcdir, "DLLDIR", ".")
pydll = "python%s%s.dll" % (major, minor)
pydllsrc = srcdir + "/PCBuild/" + pydll
--- 754,758 ----
# msidbComponentAttributesSharedDllRefCount = 8, see "Component Table"
! dlldir = PyDirectory(db, cab, root, srcdir, "DLLDIR", ".")
pydll = "python%s%s.dll" % (major, minor)
pydllsrc = srcdir + "/PCBuild/" + pydll
***************
*** 779,783 ****
else:
default_feature.set_current()
! lib = Directory(db, cab, parent, dir, dir, "%s|%s" % (parent.make_short(dir), dir))
# Add additional files
dirs[dir]=lib
--- 787,791 ----
else:
default_feature.set_current()
! lib = PyDirectory(db, cab, parent, dir, dir, "%s|%s" % (parent.make_short(dir), dir))
# Add additional files
dirs[dir]=lib
***************
*** 825,829 ****
# Add DLLs
default_feature.set_current()
! lib = Directory(db, cab, root, srcdir+"/PCBuild", "DLLs", "DLLS|DLLs")
dlls = []
tclfiles = []
--- 833,837 ----
# Add DLLs
default_feature.set_current()
! lib = PyDirectory(db, cab, root, srcdir+"/PCBuild", "DLLs", "DLLS|DLLs")
dlls = []
tclfiles = []
***************
*** 853,861 ****
# Add headers
default_feature.set_current()
! lib = Directory(db, cab, root, "include", "include", "INCLUDE|include")
lib.glob("*.h")
lib.add_file("pyconfig.h", src="../PC/pyconfig.h")
# Add import libraries
! lib = Directory(db, cab, root, "PCBuild", "libs", "LIBS|libs")
for f in dlls:
lib.add_file(f.replace('pyd','lib'))
--- 861,869 ----
# Add headers
default_feature.set_current()
! lib = PyDirectory(db, cab, root, "include", "include", "INCLUDE|include")
lib.glob("*.h")
lib.add_file("pyconfig.h", src="../PC/pyconfig.h")
# Add import libraries
! lib = PyDirectory(db, cab, root, "PCBuild", "libs", "LIBS|libs")
for f in dlls:
lib.add_file(f.replace('pyd','lib'))
***************
*** 866,870 ****
while tcldirs:
parent, phys, dir = tcldirs.pop()
! lib = Directory(db, cab, parent, phys, dir, "%s|%s" % (parent.make_short(dir), dir))
if not os.path.exists(lib.absolute):
continue
--- 874,878 ----
while tcldirs:
parent, phys, dir = tcldirs.pop()
! lib = PyDirectory(db, cab, parent, phys, dir, "%s|%s" % (parent.make_short(dir), dir))
if not os.path.exists(lib.absolute):
continue
***************
*** 876,882 ****
# Add tools
tools.set_current()
! tooldir = Directory(db, cab, root, "Tools", "Tools", "TOOLS|Tools")
for f in ['i18n', 'pynche', 'Scripts', 'versioncheck', 'webchecker']:
! lib = Directory(db, cab, tooldir, f, f, "%s|%s" % (tooldir.make_short(f), f))
lib.glob("*.py")
lib.glob("*.pyw", exclude=['pydocgui.pyw'])
--- 884,890 ----
# Add tools
tools.set_current()
! tooldir = PyDirectory(db, cab, root, "Tools", "Tools", "TOOLS|Tools")
for f in ['i18n', 'pynche', 'Scripts', 'versioncheck', 'webchecker']:
! lib = PyDirectory(db, cab, tooldir, f, f, "%s|%s" % (tooldir.make_short(f), f))
lib.glob("*.py")
lib.glob("*.pyw", exclude=['pydocgui.pyw'])
***************
*** 884,888 ****
lib.glob("*.txt")
if f == "pynche":
! x = Directory(db, cab, lib, "X", "X", "X|X")
x.glob("*.txt")
if f == 'Scripts':
--- 892,896 ----
lib.glob("*.txt")
if f == "pynche":
! x = PyDirectory(db, cab, lib, "X", "X", "X|X")
x.glob("*.txt")
if f == 'Scripts':
***************
*** 892,896 ****
# Add documentation
htmlfiles.set_current()
! lib = Directory(db, cab, root, "Doc", "Doc", "DOC|Doc")
lib.start_component("documentation", keyfile="Python%s%s.chm" % (major,minor))
lib.add_file("Python%s%s.chm" % (major, minor))
--- 900,904 ----
# Add documentation
htmlfiles.set_current()
! lib = PyDirectory(db, cab, root, "Doc", "Doc", "DOC|Doc")
lib.start_component("documentation", keyfile="Python%s%s.chm" % (major,minor))
lib.add_file("Python%s%s.chm" % (major, minor))
Index: msilib.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/msi/msilib.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** msilib.py 13 Aug 2004 15:25:28 -0000 1.11
--- msilib.py 17 Aug 2004 11:51:51 -0000 1.12
***************
*** 405,409 ****
_directories = sets.Set()
class Directory:
! def __init__(self, db, cab, basedir, physical, _logical, default):
index = 1
_logical = make_id(_logical)
--- 405,417 ----
_directories = sets.Set()
class Directory:
! def __init__(self, db, cab, basedir, physical, _logical, default, componentflags=None):
! """Create a new directory in the Directory table. There is a current component
! at each point in time for the directory, which is either explicitly created
! through start_component, or implicitly when files are added for the first
! time. Files are added into the current component, and into the cab file.
! To create a directory, a base directory object needs to be specified (can be
! None), the path to the physical directory, and a logical directory name.
! Default specifies the DefaultDir slot in the directory table. componentflags
! specifies the default flags that new components get."""
index = 1
_logical = make_id(_logical)
***************
*** 422,425 ****
--- 430,434 ----
self.ids = sets.Set()
self.keyfiles = {}
+ self.componentflags = componentflags
if basedir:
self.absolute = os.path.join(basedir.absolute, physical)
***************
*** 430,434 ****
add_data(db, "Directory", [(logical, blogical, default)])
! def start_component(self, component = None, feature = None, flags = 0, keyfile = None):
uuid = gen_uuid()
if component is None:
--- 439,450 ----
add_data(db, "Directory", [(logical, blogical, default)])
! def start_component(self, component = None, feature = None, flags = None, keyfile = None):
! """Add an entry to the Component table, and make this component the current for this
! directory. If no component name is given, the directory name is used. If no feature
! is given, the current feature is used. If no flags are given, the directory's default
! flags are used. If no keyfile is given, the KeyPath is left null in the Component
! table."""
! if flags is None:
! flags = self.componentflags
uuid = gen_uuid()
if component is None:
***************
*** 482,485 ****
--- 498,506 ----
def add_file(self, file, src=None, version=None, language=None):
+ """Add a file to the current component of the directory, starting a new one
+ one if there is no current component. By default, the file name in the source
+ and the file table will be identical. If the src file is specified, it is
+ interpreted relative to the current directory. Optionally, a version and a
+ language can be specified for the entry in the File table."""
if not self.component:
self.start_component(self.logical, current_feature)
***************
*** 525,528 ****
--- 546,551 ----
def glob(self, pattern, exclude = None):
+ """Add a list of files to the current component as specified in the
+ glob pattern. Individual files can be excluded in the exclude list."""
files = glob.glob1(self.absolute, pattern)
for f in files:
More information about the Python-checkins
mailing list