From bc9d15a1494ed5341cdf918d814a908ae0fd7cea Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sun, 13 Jun 2021 03:15:29 +0800 Subject: [PATCH] Generate dev shard configuration using patchman --- nel/tools/build_gamedata/0_setup.py | 9 ++++++++ nel/tools/build_gamedata/b3_shard_dev.py | 21 +++++++++++++++++++ .../build_gamedata/configuration/tools.py | 1 + 3 files changed, 31 insertions(+) diff --git a/nel/tools/build_gamedata/0_setup.py b/nel/tools/build_gamedata/0_setup.py index fd85aa5a7..905a88e81 100755 --- a/nel/tools/build_gamedata/0_setup.py +++ b/nel/tools/build_gamedata/0_setup.py @@ -257,6 +257,12 @@ if not args.noconf: LinuxClientExecutableDirectory except NameError: LinuxClientExecutableDirectory = "R:/build/gcc_client/bin" + try: + if args.preset: + DummyUnknownName + PatchmanDevDirectory + except NameError: + PatchmanDevDirectory = "R:/patchman/terminal_dev" try: if args.preset: DummyUnknownName @@ -358,6 +364,7 @@ if not args.noconf: WindowsExeDllCfgDirectories[6] = askVar(log, "[IN] Septenary Windows exe/dll/cfg Directory", WindowsExeDllCfgDirectories[6]).replace("\\", "/") LinuxServiceExecutableDirectory = askVar(log, "[IN] Linux Service Executable Directory", LinuxServiceExecutableDirectory).replace("\\", "/") LinuxClientExecutableDirectory = askVar(log, "[IN] Linux Client Executable Directory", LinuxClientExecutableDirectory).replace("\\", "/") + PatchmanDevDirectory = askVar(log, "[IN] Patchman Directory", PatchmanDevDirectory).replace("\\", "/") PatchmanCfgAdminDirectory = askVar(log, "[IN] Patchman Cfg Admin Directory", PatchmanCfgAdminDirectory).replace("\\", "/") PatchmanCfgDefaultDirectory = askVar(log, "[IN] Patchman Cfg Default Directory", PatchmanCfgDefaultDirectory).replace("\\", "/") PatchmanBridgeServerDirectory = askVar(log, "[OUT] Patchman Bridge Server Patch Directory", PatchmanBridgeServerDirectory).replace("\\", "/") @@ -453,6 +460,7 @@ if not args.noconf: sf.write("WindowsExeDllCfgDirectories = " + str(WindowsExeDllCfgDirectories) + "\n") sf.write("LinuxServiceExecutableDirectory = \"" + str(LinuxServiceExecutableDirectory) + "\"\n") sf.write("LinuxClientExecutableDirectory = \"" + str(LinuxClientExecutableDirectory) + "\"\n") + sf.write("PatchmanDevDirectory = \"" + str(PatchmanDevDirectory) + "\"\n") sf.write("PatchmanCfgAdminDirectory = \"" + str(PatchmanCfgAdminDirectory) + "\"\n") sf.write("PatchmanCfgDefaultDirectory = \"" + str(PatchmanCfgDefaultDirectory) + "\"\n") sf.write("PatchmanBridgeServerDirectory = \"" + str(PatchmanBridgeServerDirectory) + "\"\n") @@ -577,6 +585,7 @@ if not args.noverify: findTool(log, ToolDirectories, TranslationToolsTool, ToolSuffix) findTool(log, ToolDirectories, BuildWorldPackedColTool, ToolSuffix) findTool(log, ToolDirectories, R2IslandsTexturesTool, ToolSuffix) + findTool(log, ToolDirectories, PatchmanServiceTool, ToolSuffix) log.close() if os.path.isfile("0_setup.log"): diff --git a/nel/tools/build_gamedata/b3_shard_dev.py b/nel/tools/build_gamedata/b3_shard_dev.py index 2032e9e92..7f0ef0c4e 100644 --- a/nel/tools/build_gamedata/b3_shard_dev.py +++ b/nel/tools/build_gamedata/b3_shard_dev.py @@ -45,6 +45,10 @@ printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") +# Find tools +PatchmanService = findTool(log, ToolDirectories, PatchmanServiceTool, ToolSuffix) +printLog(log, "") + mkPath(log, ShardDevDirectory) mkPath(log, ShardDevDirectory + "/local") printLog(log, ">>> Generate shard dev local.cfg <<<") @@ -80,6 +84,23 @@ for execDir in InstallShardDataExecutables: copyFileListNoTreeIfNeeded(log, InstallDirectory, ShardDevDirectory + "/live/" + dstDir, execDir[3]) printLog(log, "") + +if PatchmanService == "": + toolLogFail(log, PatchmanServiceTool, ToolSuffix) +else: + mkPath(log, PatchmanDevDirectory) + cwDir = os.getcwd().replace("\\", "/") + os.chdir(PatchmanDevDirectory) + os.remove("log.log") + subprocess.call([ PatchmanService, "-C.", "-L." ]) + if os.path.isfile("log.log"): + f = open("log.log", "r") + for l in f: + log.write(l) + f.close() + os.chdir(cwDir) + printLog(log, "") + log.close() if os.path.isfile("b3_shard_dev.log"): os.remove("b3_shard_dev.log") diff --git a/nel/tools/build_gamedata/configuration/tools.py b/nel/tools/build_gamedata/configuration/tools.py index ee933c8e9..e27f4c490 100755 --- a/nel/tools/build_gamedata/configuration/tools.py +++ b/nel/tools/build_gamedata/configuration/tools.py @@ -98,4 +98,5 @@ PatchGenTool = "patch_gen" TranslationToolsTool = "translation_tools" BuildWorldPackedColTool = "build_world_packed_col" R2IslandsTexturesTool = "r2_islands_textures" +PatchmanServiceTool = "ryzom_patchman_service" SevenZipTool = "7za"