mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
don't up the patch_version number unless there's really a change
This commit is contained in:
parent
471bb53139
commit
5ea8a8c869
@ -1060,11 +1060,15 @@ class Packager:
|
||||
if patchVersion:
|
||||
self.patchVersion = patchVersion
|
||||
|
||||
# Extract the base_version and patch entries, if any, and
|
||||
# preserve these entries verbatim for the next version.
|
||||
# Extract the base_version, top_version, and patch
|
||||
# entries, if any, and preserve these entries verbatim for
|
||||
# the next version.
|
||||
xbase = xpackage.FirstChildElement('base_version')
|
||||
if xbase:
|
||||
self.patches.append(xbase.Clone())
|
||||
xtop = xpackage.FirstChildElement('top_version')
|
||||
if xtop:
|
||||
self.patches.append(xtop.Clone())
|
||||
|
||||
xpatch = xpackage.FirstChildElement('patch')
|
||||
while xpatch:
|
||||
|
@ -333,6 +333,43 @@ class PatchMaker:
|
||||
# here for those hosts.
|
||||
self.hostUrl = None
|
||||
|
||||
self.currentFile = None
|
||||
self.baseFile = None
|
||||
self.topFile = None
|
||||
self.compressedFilename = None
|
||||
compressedFile = None
|
||||
|
||||
# Assume there are changes for this version, until we
|
||||
# discover that there aren't.
|
||||
isNewVersion = True
|
||||
|
||||
# Get the actual current version.
|
||||
xarchive = xpackage.FirstChildElement('uncompressed_archive')
|
||||
if xarchive:
|
||||
self.currentFile = FileSpec()
|
||||
self.currentFile.loadXml(xarchive)
|
||||
|
||||
# Get the top_version--the top (newest) of the patch
|
||||
# chain.
|
||||
xarchive = xpackage.FirstChildElement('top_version')
|
||||
if xarchive:
|
||||
self.topFile = FileSpec()
|
||||
self.topFile.loadXml(xarchive)
|
||||
|
||||
if self.topFile.hash == self.currentFile.hash:
|
||||
# No new version this pass.
|
||||
isNewVersion = False
|
||||
else:
|
||||
# There's a new version this pass. Update it.
|
||||
self.topFile = copy.copy(self.currentFile)
|
||||
self.anyChanges = True
|
||||
|
||||
else:
|
||||
# If there isn't a top_version yet, we have to make
|
||||
# one, by duplicating the currentFile.
|
||||
self.topFile = copy.copy(self.currentFile)
|
||||
self.anyChanges = True
|
||||
|
||||
# Get the current patch version. If we have a
|
||||
# patch_version attribute, it refers to this particular
|
||||
# instance of the file, and that is the current patch
|
||||
@ -347,25 +384,10 @@ class PatchMaker:
|
||||
patchVersion = xpackage.Attribute('last_patch_version')
|
||||
if patchVersion:
|
||||
self.patchVersion = int(patchVersion)
|
||||
if isNewVersion:
|
||||
self.patchVersion += 1
|
||||
self.anyChanges = True
|
||||
|
||||
self.currentFile = None
|
||||
self.baseFile = None
|
||||
self.compressedFilename = None
|
||||
|
||||
xarchive = xpackage.FirstChildElement('uncompressed_archive')
|
||||
if xarchive:
|
||||
self.currentFile = FileSpec()
|
||||
self.currentFile.loadXml(xarchive)
|
||||
|
||||
# We need to know the filename of the compressed archive
|
||||
# (the uncompressed_archive may not actually exist
|
||||
# anymore, but the compressed_archive still should).
|
||||
xarchive = xpackage.FirstChildElement('compressed_archive')
|
||||
if xarchive:
|
||||
self.compressedFilename = xarchive.Attribute('filename')
|
||||
|
||||
# Put the patchVersion in the compressed filename, for
|
||||
# cache-busting. This means when the version changes, its
|
||||
# URL will also change, guaranteeing that users will
|
||||
@ -456,6 +478,10 @@ class PatchMaker:
|
||||
self.baseFile.storeXml(xarchive)
|
||||
xpackage.InsertEndChild(xarchive)
|
||||
|
||||
xarchive = TiXmlElement('top_version')
|
||||
self.topFile.storeXml(xarchive)
|
||||
xpackage.InsertEndChild(xarchive)
|
||||
|
||||
for patchfile in self.patches:
|
||||
xpatch = patchfile.makeXml(self)
|
||||
xpackage.InsertEndChild(xpatch)
|
||||
|
Loading…
x
Reference in New Issue
Block a user