Generate 7z server patch, ref ryzom/ryzomcore#586

develop
kaetemi 5 years ago
parent 9b0852a91d
commit 5c0c6d2417

@ -49,6 +49,9 @@ printLog(log, "-------")
printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time())))
printLog(log, "") printLog(log, "")
# Find tools
SevenZip = findTool(log, ToolDirectories, SevenZipTool, ToolSuffix)
# List the directories that will be used # List the directories that will be used
archiveDirectories = [ ] archiveDirectories = [ ]
for dir in InstallShardDataDirectories: for dir in InstallShardDataDirectories:
@ -89,23 +92,29 @@ else:
printLog(log, "") printLog(log, "")
if not args.admininstall: if not args.admininstall:
printLog(log, ">>> Create new version <<<") if SevenZip == "":
newVersion = 1 toolLogFail(log, SevenZipTool, ToolSuffix)
vstr = str(newVersion).zfill(6) else:
vpath = PatchmanBridgeServerDirectory + "/" + vstr printLog(log, ">>> Create new version <<<")
while os.path.exists(vpath): newVersion = 1
newVersion = newVersion + 1
vstr = str(newVersion).zfill(6) vstr = str(newVersion).zfill(6)
vpath = PatchmanBridgeServerDirectory + "/" + vstr vpath = PatchmanBridgeServerDirectory + "/" + vstr
mkPath(log, vpath) while os.path.exists(vpath):
for dir in archiveDirectories: newVersion = newVersion + 1
mkPath(log, ShardInstallDirectory + "/" + dir) vstr = str(newVersion).zfill(6)
tgzPath = vpath + "/" + dir + ".tgz" vpath = PatchmanBridgeServerDirectory + "/" + vstr
printLog(log, "WRITE " + tgzPath) mkPath(log, vpath)
tar = tarfile.open(tgzPath, "w:gz") for dir in archiveDirectories:
tar.add(ShardInstallDirectory + "/" + dir, arcname = dir) mkPath(log, ShardInstallDirectory + "/" + dir)
tar.close() # tgzPath = vpath + "/" + dir + ".tgz"
printLog(log, "") # printLog(log, "WRITE " + tgzPath)
# tar = tarfile.open(tgzPath, "w:gz")
# tar.add(ShardInstallDirectory + "/" + dir, arcname = dir)
# tar.close()
sevenZipPath = vpath + "/" + dir + ".7z"
printLog(log, "WRITE " + sevenZipPath)
subprocess.call([ SevenZip, "a", sevenZipPath, ShardInstallDirectory + "/" + dir ])
printLog(log, "")
log.close() log.close()
if os.path.isfile("c1_shard_patch.log"): if os.path.isfile("c1_shard_patch.log"):

@ -98,3 +98,4 @@ PatchGenTool = "patch_gen"
TranslationToolsTool = "translation_tools" TranslationToolsTool = "translation_tools"
BuildWorldPackedColTool = "build_world_packed_col" BuildWorldPackedColTool = "build_world_packed_col"
R2IslandsTexturesTool = "r2_islands_textures" R2IslandsTexturesTool = "r2_islands_textures"
SevenZipTool = "7za"

Loading…
Cancel
Save