from direct.p3d.PatchMaker import PatchMaker
Deprecated since version 1.10.0: The p3d packaging system has been replaced with the new setuptools-based system. See the Distributing Panda3D Applications manual section.
- class PatchMaker(installDir)
This class will operate on an existing package install directory, as generated by the Packager, and create patchfiles between versions as needed. It is also used at runtime, to apply the downloaded patches.
- class Package(packageDesc, patchMaker, xpackage=None)
This is a particular package. This contains all of the information needed to reconstruct the package’s desc file.
- __init__(self, packageDesc, patchMaker, xpackage=None)
Returns the key to locate the “base” or oldest version of this package.
Returns the key to locate the current version of this package.
- getGenericKey(self, fileSpec)
Returns the key that has the indicated hash.
Returns the key to locate the “top” or newest version of this package.
- readDescFile(self, doProcessing=False)
Reads the existing package.xml file and stores it in this class for later rewriting. if doProcessing is true, it may massage the file and the directory contents in preparation for building patches. Returns true on success, false on failure.
Rewrites the desc file with the new patch information.
- class PackageVersion(packageName, platform, version, hostUrl, file)
A specific patch version of a package. This is not just the package’s “version” string; it also corresponds to the particular patch version, which increments independently of the “version”.
- __init__(self, packageName, platform, version, hostUrl, file)
- applyPatch(self, origFile, patchFilename)
Applies the named patch to the indicated original file, storing the results in a temporary file, and returns that temporary Filename. Returns None on failure.
Returns the Filename of the archive file associated with this version. If the file doesn’t actually exist on disk, a temporary file will be created. Returns None if the file can’t be recreated.
- getNext(self, package)
Gets the next patch in the chain towards this package.
- getPatchChain(self, startPv, alreadyVisited=)
Returns a list of patches that, when applied in sequence to the indicated PackageVersion object, will produce this PackageVersion object. Returns None if no chain can be found.
- getRecreateFilePlan(self, alreadyVisited=)
Returns the tuple (startFile, startPv, plan), describing how to recreate the archive file for this version. startFile and startPv is the Filename and packageVersion of the file to start with, and plan is a list of tuples (patchfile, pv), listing the patches to apply in sequence, and the packageVersion object associated with each patch. Returns (None, None, None) if there is no way to recreate this archive file.
- class Patchfile(package)
A single patchfile for a package.
- __init__(self, package)
- fromFile(self, packageDir, patchFilename, sourceFile, targetFile)
Creates the data structures from an existing patchfile on disk.
Returns the key for locating the package that this patchfile can be applied to.
Returns the key for locating the package that this patchfile will generate.
- loadXml(self, xpatch)
Reads the data structures from an xml file.
- makeXml(self, package)
- __init__(self, installDir)
- buildPatch(self, v1, v2, package, patchFilename)
Builds a patch from PackageVersion v1 to PackageVersion v2, and stores it in patchFilename.pz. Returns true on success, false on failure.
Builds up the chains of PackageVersions and the patchfiles that connect them.
- buildPatchFile(self, origFilename, newFilename, patchFilename, printOrigName, printNewName)
Creates a patch file from origFilename to newFilename, storing the result in patchFilename. Returns true on success, false on failure.
- buildPatches(self, packageNames=None)
Makes the patches required in a particular directory structure on disk. If packageNames is None, this makes patches for all packages; otherwise, it should be a list of package name strings, limiting the set of packages that are processed.
Should be called on exit to remove temporary files and such created during processing.
- getPackageVersion(self, key)
Returns a shared PackageVersion object for the indicated key.
- getPatchChainToCurrent(self, descFilename, fileSpec)
Reads the package defined in the indicated desc file, and constructs a patch chain from the version represented by fileSpec to the current version of this package, if possible. Returns the patch chain if successful, or None otherwise.
Walks through the list of packages, and builds missing patches for each one.
- processPackage(self, package)
Builds missing patches for the indicated package.
- processSomePackages(self, packageNames)
Builds missing patches only for the named packages.
Reads the contents.xml file at the beginning of processing.
- readPackageDescFile(self, descFilename)
Reads a desc file associated with a particular package, and adds the package to self.packages. Returns the Package object, or None on failure.
- recordPatchfile(self, patchfile)
Adds the indicated patchfile to the patch chains.
Writes the contents.xml file at the end of processing.