|
@@ -339,6 +339,10 @@ class Packager:
|
|
|
def close(self):
|
|
def close(self):
|
|
|
""" Writes out the contents of the current package. """
|
|
""" Writes out the contents of the current package. """
|
|
|
|
|
|
|
|
|
|
+ if not self.p3dApplication and not self.packager.allowPackages:
|
|
|
|
|
+ message = 'Cannot generate packages without an installDir; use -i'
|
|
|
|
|
+ raise PackagerError, message
|
|
|
|
|
+
|
|
|
if not self.host:
|
|
if not self.host:
|
|
|
self.host = self.packager.host
|
|
self.host = self.packager.host
|
|
|
|
|
|
|
@@ -629,11 +633,14 @@ class Packager:
|
|
|
|
|
|
|
|
print "Generating %s" % (self.packageFilename)
|
|
print "Generating %s" % (self.packageFilename)
|
|
|
|
|
|
|
|
- self.packageFullpath = Filename(self.packager.installDir, self.packageFilename)
|
|
|
|
|
- self.packageFullpath.makeDir()
|
|
|
|
|
-
|
|
|
|
|
if self.p3dApplication:
|
|
if self.p3dApplication:
|
|
|
|
|
+ self.packageFullpath = Filename(self.packager.p3dInstallDir, self.packageFilename)
|
|
|
|
|
+ self.packageFullpath.makeDir()
|
|
|
self.makeP3dInfo()
|
|
self.makeP3dInfo()
|
|
|
|
|
+ else:
|
|
|
|
|
+ self.packageFullpath = Filename(self.packager.installDir, self.packageFilename)
|
|
|
|
|
+ self.packageFullpath.makeDir()
|
|
|
|
|
+
|
|
|
self.multifile.repack()
|
|
self.multifile.repack()
|
|
|
|
|
|
|
|
# Also sign the multifile before we close it.
|
|
# Also sign the multifile before we close it.
|
|
@@ -686,6 +693,10 @@ class Packager:
|
|
|
if self.version:
|
|
if self.version:
|
|
|
packageDir += '/' + self.version
|
|
packageDir += '/' + self.version
|
|
|
|
|
|
|
|
|
|
+ if not self.packager.allowPackages:
|
|
|
|
|
+ message = 'Cannot generate packages without an installDir; use -i'
|
|
|
|
|
+ raise PackagerError, message
|
|
|
|
|
+
|
|
|
installPath = Filename(self.packager.installDir, packageDir)
|
|
installPath = Filename(self.packager.installDir, packageDir)
|
|
|
# Remove any files already in the installPath.
|
|
# Remove any files already in the installPath.
|
|
|
origFiles = vfs.scanDirectory(installPath)
|
|
origFiles = vfs.scanDirectory(installPath)
|
|
@@ -2144,8 +2155,18 @@ class Packager:
|
|
|
|
|
|
|
|
self.currentPackage = None
|
|
self.currentPackage = None
|
|
|
|
|
|
|
|
- # We must have an actual install directory.
|
|
|
|
|
- assert(self.installDir)
|
|
|
|
|
|
|
+ if self.installDir:
|
|
|
|
|
+ # If we were given an install directory, we can build
|
|
|
|
|
+ # packages as well as plain p3d files, and it all goes
|
|
|
|
|
+ # into the specified directory.
|
|
|
|
|
+ self.p3dInstallDir = self.installDir
|
|
|
|
|
+ self.allowPackages = True
|
|
|
|
|
+ else:
|
|
|
|
|
+ # If we don't have an actual install directory, we can
|
|
|
|
|
+ # only build p3d files, and we drop them into the current
|
|
|
|
|
+ # directory.
|
|
|
|
|
+ self.p3dInstallDir = '.'
|
|
|
|
|
+ self.allowPackages = False
|
|
|
|
|
|
|
|
if not PandaSystem.getPackageVersionString() or not PandaSystem.getPackageHostUrl():
|
|
if not PandaSystem.getPackageVersionString() or not PandaSystem.getPackageHostUrl():
|
|
|
raise PackagerError, 'This script must be run using a version of Panda3D that has been built\nfor distribution. Try using ppackage.p3d or packp3d.p3d instead.'
|
|
raise PackagerError, 'This script must be run using a version of Panda3D that has been built\nfor distribution. Try using ppackage.p3d or packp3d.p3d instead.'
|
|
@@ -2170,9 +2191,10 @@ class Packager:
|
|
|
if not package.p3dApplication and not package.solo:
|
|
if not package.p3dApplication and not package.solo:
|
|
|
packageNames.append(package.packageName)
|
|
packageNames.append(package.packageName)
|
|
|
|
|
|
|
|
- from PatchMaker import PatchMaker
|
|
|
|
|
- pm = PatchMaker(self.installDir)
|
|
|
|
|
- pm.buildPatches(packageNames = packageNames)
|
|
|
|
|
|
|
+ if packageNames:
|
|
|
|
|
+ from PatchMaker import PatchMaker
|
|
|
|
|
+ pm = PatchMaker(self.installDir)
|
|
|
|
|
+ pm.buildPatches(packageNames = packageNames)
|
|
|
|
|
|
|
|
def readPackageDef(self, packageDef, packageNames = None):
|
|
def readPackageDef(self, packageDef, packageNames = None):
|
|
|
""" Reads the named .pdef file and constructs the named
|
|
""" Reads the named .pdef file and constructs the named
|
|
@@ -2339,6 +2361,11 @@ class Packager:
|
|
|
|
|
|
|
|
package.p3dApplication = p3dApplication
|
|
package.p3dApplication = p3dApplication
|
|
|
package.solo = solo
|
|
package.solo = solo
|
|
|
|
|
+
|
|
|
|
|
+ if not package.p3dApplication and not self.allowPackages:
|
|
|
|
|
+ message = 'Cannot generate packages without an installDir; use -i'
|
|
|
|
|
+ raise PackagerError, message
|
|
|
|
|
+
|
|
|
|
|
|
|
|
def endPackage(self):
|
|
def endPackage(self):
|
|
|
""" Closes the current package specification. This actually
|
|
""" Closes the current package specification. This actually
|
|
@@ -3123,6 +3150,10 @@ class Packager:
|
|
|
self.contents = {}
|
|
self.contents = {}
|
|
|
self.contentsChanged = False
|
|
self.contentsChanged = False
|
|
|
|
|
|
|
|
|
|
+ if not self.allowPackages:
|
|
|
|
|
+ # Don't bother.
|
|
|
|
|
+ return
|
|
|
|
|
+
|
|
|
contentsFilename = Filename(self.installDir, 'contents.xml')
|
|
contentsFilename = Filename(self.installDir, 'contents.xml')
|
|
|
doc = TiXmlDocument(contentsFilename.toOsSpecific())
|
|
doc = TiXmlDocument(contentsFilename.toOsSpecific())
|
|
|
if not doc.LoadFile():
|
|
if not doc.LoadFile():
|