From f523bf488875e05ee091bddaf6ac54bb31bd02cc Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 23 May 2014 17:25:52 +0200 Subject: [PATCH] Add --admininstall parameter to c1_shard_patch --- .../tools/build_gamedata/c1_shard_patch.py | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/code/nel/tools/build_gamedata/c1_shard_patch.py b/code/nel/tools/build_gamedata/c1_shard_patch.py index a67613f67..b67b053a8 100644 --- a/code/nel/tools/build_gamedata/c1_shard_patch.py +++ b/code/nel/tools/build_gamedata/c1_shard_patch.py @@ -24,9 +24,13 @@ # along with this program. If not, see . # -import time, sys, os, shutil, subprocess, distutils.dir_util, tarfile +import time, sys, os, shutil, subprocess, distutils.dir_util, tarfile, argparse sys.path.append("configuration") +parser = argparse.ArgumentParser(description='Ryzom Core - Build Gamedata - Shard Patch') +parser.add_argument('--admininstall', '-ai', action='store_true') +args = parser.parse_args() + if os.path.isfile("log.log"): os.remove("log.log") log = open("log.log", "w") @@ -84,23 +88,24 @@ else: printLog(log, "SKIP " + adminInstallTgz) printLog(log, "") -printLog(log, ">>> Create new version <<<") -newVersion = 1 -vstr = str(newVersion).zfill(6) -vpath = PatchmanBridgeServerDirectory + "/" + vstr -while os.path.exists(vpath): - newVersion = newVersion + 1 +if not args.admininstall: + printLog(log, ">>> Create new version <<<") + newVersion = 1 vstr = str(newVersion).zfill(6) vpath = PatchmanBridgeServerDirectory + "/" + vstr -mkPath(log, vpath) -for dir in archiveDirectories: - mkPath(log, ShardInstallDirectory + "/" + dir) - tgzPath = vpath + "/" + dir + ".tgz" - printLog(log, "WRITE " + tgzPath) - tar = tarfile.open(tgzPath, "w:gz") - tar.add(ShardInstallDirectory + "/" + dir, arcname = dir) - tar.close() -printLog(log, "") + while os.path.exists(vpath): + newVersion = newVersion + 1 + vstr = str(newVersion).zfill(6) + vpath = PatchmanBridgeServerDirectory + "/" + vstr + mkPath(log, vpath) + for dir in archiveDirectories: + mkPath(log, ShardInstallDirectory + "/" + dir) + tgzPath = vpath + "/" + dir + ".tgz" + printLog(log, "WRITE " + tgzPath) + tar = tarfile.open(tgzPath, "w:gz") + tar.add(ShardInstallDirectory + "/" + dir, arcname = dir) + tar.close() + printLog(log, "") log.close() if os.path.isfile("c1_shard_patch.log"):