Wipe packed shard sheets if visual slot table has changed

merge/2021-11-19
kaetemi 3 years ago
parent c71980df2e
commit 3aeef70db8
No known key found for this signature in database
GPG Key ID: 9873C4D40BB479BC

@ -96,6 +96,20 @@ def needUpdateLogRemoveDest(log, source, dest):
printLog(log, "SKIP " + dest)
return 0
def needUpdateLogRemoveDestSilentSkip(log, source, dest):
if (os.path.isfile(source)):
if (os.path.isfile(dest)):
if (os.stat(source).st_mtime > os.stat(dest).st_mtime):
os.remove(dest)
printLog(log, source + " -> " + dest)
return 1
else:
return 0
printLog(log, source + " -> " + dest)
return 1
printLog(log, "MISSING " + source)
return 0
def copyFileList(log, dir_source, dir_target, files):
for fileName in files:
if fileName != ".svn" and fileName != ".." and fileName != "." and fileName != "*.*":

@ -57,6 +57,11 @@ else:
mkPath(log, ExportBuildDirectory + "/" + VisualSlotTabBuildDirectory)
mkPath(log, DataShardDirectory + "/mirror_sheets") # FIXME: Hardcoded path mirror_sheets
mkPath(log, ExportBuildDirectory + "/" + SheetsShardBuildDirectory)
# Wipe all sheets older than visual_slot.tab
for p in os.listdir(ExportBuildDirectory + "/" + SheetsShardBuildDirectory):
fp = ExportBuildDirectory + "/" + SheetsShardBuildDirectory + "/" + p
if os.path.isfile(fp) and p.endswith(".packed_sheets"):
needUpdateLogRemoveDestSilentSkip(log, ExportBuildDirectory + "/" + VisualSlotTabBuildDirectory + "/visual_slot.tab", fp)
# sheets_packer_shard <leveldesign> <dfn> <datasets> <tab> <build_packed_sheets>
subprocess.call([ SheetsPackerShard, LeveldesignDirectory, LeveldesignDfnDirectory, DataShardDirectory + "/mirror_sheets", ExportBuildDirectory + "/" + VisualSlotTabBuildDirectory, ExportBuildDirectory + "/" + SheetsShardBuildDirectory ])
printLog(log, "")

Loading…
Cancel
Save