mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-05 11:28:17 -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:
|
if patchVersion:
|
||||||
self.patchVersion = patchVersion
|
self.patchVersion = patchVersion
|
||||||
|
|
||||||
# Extract the base_version and patch entries, if any, and
|
# Extract the base_version, top_version, and patch
|
||||||
# preserve these entries verbatim for the next version.
|
# entries, if any, and preserve these entries verbatim for
|
||||||
|
# the next version.
|
||||||
xbase = xpackage.FirstChildElement('base_version')
|
xbase = xpackage.FirstChildElement('base_version')
|
||||||
if xbase:
|
if xbase:
|
||||||
self.patches.append(xbase.Clone())
|
self.patches.append(xbase.Clone())
|
||||||
|
xtop = xpackage.FirstChildElement('top_version')
|
||||||
|
if xtop:
|
||||||
|
self.patches.append(xtop.Clone())
|
||||||
|
|
||||||
xpatch = xpackage.FirstChildElement('patch')
|
xpatch = xpackage.FirstChildElement('patch')
|
||||||
while xpatch:
|
while xpatch:
|
||||||
|
@ -332,6 +332,43 @@ class PatchMaker:
|
|||||||
# other hosts, which means we'll need to fill in a value
|
# other hosts, which means we'll need to fill in a value
|
||||||
# here for those hosts.
|
# here for those hosts.
|
||||||
self.hostUrl = None
|
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
|
# Get the current patch version. If we have a
|
||||||
# patch_version attribute, it refers to this particular
|
# patch_version attribute, it refers to this particular
|
||||||
@ -347,25 +384,10 @@ class PatchMaker:
|
|||||||
patchVersion = xpackage.Attribute('last_patch_version')
|
patchVersion = xpackage.Attribute('last_patch_version')
|
||||||
if patchVersion:
|
if patchVersion:
|
||||||
self.patchVersion = int(patchVersion)
|
self.patchVersion = int(patchVersion)
|
||||||
self.patchVersion += 1
|
if isNewVersion:
|
||||||
|
self.patchVersion += 1
|
||||||
self.anyChanges = True
|
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
|
# Put the patchVersion in the compressed filename, for
|
||||||
# cache-busting. This means when the version changes, its
|
# cache-busting. This means when the version changes, its
|
||||||
# URL will also change, guaranteeing that users will
|
# URL will also change, guaranteeing that users will
|
||||||
@ -455,6 +477,10 @@ class PatchMaker:
|
|||||||
xarchive = TiXmlElement('base_version')
|
xarchive = TiXmlElement('base_version')
|
||||||
self.baseFile.storeXml(xarchive)
|
self.baseFile.storeXml(xarchive)
|
||||||
xpackage.InsertEndChild(xarchive)
|
xpackage.InsertEndChild(xarchive)
|
||||||
|
|
||||||
|
xarchive = TiXmlElement('top_version')
|
||||||
|
self.topFile.storeXml(xarchive)
|
||||||
|
xpackage.InsertEndChild(xarchive)
|
||||||
|
|
||||||
for patchfile in self.patches:
|
for patchfile in self.patches:
|
||||||
xpatch = patchfile.makeXml(self)
|
xpatch = patchfile.makeXml(self)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user