From 0e27ff37f333f5709f70c7d2162c41fb71164ae0 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Tue, 15 Nov 2011 14:55:57 +0100 Subject: [PATCH] Added: Use ssh key for 8_upload script. --- code/nel/tools/build_gamedata/8_upload.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/code/nel/tools/build_gamedata/8_upload.py b/code/nel/tools/build_gamedata/8_upload.py index 0b51a3683..1b60aad68 100644 --- a/code/nel/tools/build_gamedata/8_upload.py +++ b/code/nel/tools/build_gamedata/8_upload.py @@ -57,7 +57,7 @@ printLog(log, "") Psftp = findFileMultiDir(log, ToolDirectories + WindowsExeDllCfgDirectories, UploadPsftpTool) printLog(log, "PSFTP " + Psftp) -def downloadVersionTag(server, user, dir): +def downloadVersionTag(server, user, sshkey, dir): if os.path.isfile("upload.tag"): os.remove("upload.tag") if os.path.isfile("upload.batch"): @@ -67,7 +67,7 @@ def downloadVersionTag(server, user, dir): ub.write("get upload.tag upload.tag\n") ub.write("quit\n") ub.close() - subprocess.call([ Psftp, "-b", "upload.batch", user + "@" + server ]) + subprocess.call([ Psftp, "-b", "upload.batch", "-i", sshkey, user + "@" + server ]) os.remove("upload.batch") if os.path.isfile("upload.tag"): ft = open("upload.tag") @@ -122,8 +122,8 @@ def listDirectoryUpload(ft, ub, udb, dir): printLog(log, "listDirectoryUpload: file not dir or file?!" + fileFull) return nft -def uploadSftp(server, user, dir_to, dir_from, addcmd): - ft = downloadVersionTag(server, user, dir_to) +def uploadSftp(server, user, sshkey, dir_to, dir_from, addcmd): + ft = downloadVersionTag(server, user, sshkey, dir_to) if isDirectoryNeeded(ft, dir_from): if os.path.isfile("upload_dir.batch"): os.remove("upload_dir.batch") @@ -146,8 +146,8 @@ def uploadSftp(server, user, dir_to, dir_from, addcmd): ub.close() udb.write("quit\n") udb.close() - subprocess.call([ Psftp, "-be", "-b", "upload_dir.batch", user + "@" + server ]) - subprocess.call([ Psftp, "-b", "upload.batch", user + "@" + server ]) + subprocess.call([ Psftp, "-be", "-b", "upload_dir.batch", "-i", sshkey, user + "@" + server ]) + subprocess.call([ Psftp, "-b", "upload.batch", "-i", sshkey, user + "@" + server ]) os.remove("upload_dir.batch") os.remove("upload.batch") os.remove("upload.tag") @@ -156,23 +156,23 @@ def uploadSftp(server, user, dir_to, dir_from, addcmd): printLog(log, ">>> Upload patch <<<") for target in UploadPatch: - uploadSftp(target[0], target[1], target[3], ClientPatchDirectory + "/patch", [ ]) + uploadSftp(target[0], target[1], target[2], target[3], ClientPatchDirectory + "/patch", [ ]) printLog(log, ">>> Upload data_shard <<<") for target in UploadShard: - uploadSftp(target[0], target[1], target[3], DataShardDirectory, [ "rm *.packed_sheets", "rm primitive_cache/*.binprim" ]) + uploadSftp(target[0], target[1], target[2], target[3], DataShardDirectory, [ "rm *.packed_sheets", "rm primitive_cache/*.binprim" ]) printLog(log, ">>> Upload data_common <<<") for target in UploadCommon: - uploadSftp(target[0], target[1], target[3], DataCommonDirectory, [ ]) + uploadSftp(target[0], target[1], target[2], target[3], DataCommonDirectory, [ ]) printLog(log, ">>> Upload data_leveldesign/leveldesign <<<") for target in UploadLeveldesign: - uploadSftp(target[0], target[1], target[3], LeveldesignDirectory, [ ]) + uploadSftp(target[0], target[1], target[2], target[3], LeveldesignDirectory, [ ]) printLog(log, ">>> Upload data_leveldesign/primitives <<<") for target in UploadPrimitives: - uploadSftp(target[0], target[1], target[3], PrimitivesDirectory, [ ]) + uploadSftp(target[0], target[1], target[2], target[3], PrimitivesDirectory, [ ]) log.close() if os.path.isfile("8_upload.log"):