Added aqua_speed for rite geo 50 tryker
[ryzomcore.git] / nel / tools / build_gamedata / d2_client_install.py
blob4041d79c22b7ba286ae3cb154d204f8778e03508
1 #!/usr/bin/python
2 #
3 # \file d2_client_install.py
4 # \brief Install to client install
5 # \date 2009-02-18 16:19GMT
6 # \author Jan Boon (Kaetemi)
7 # Python port of game data build pipeline.
8 # Install to client install
9 #
10 # NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
11 # Copyright (C) 2009-2014 by authors
13 # This program is free software: you can redistribute it and/or modify
14 # it under the terms of the GNU Affero General Public License as
15 # published by the Free Software Foundation, either version 3 of the
16 # License, or (at your option) any later version.
18 # This program is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # GNU Affero General Public License for more details.
23 # You should have received a copy of the GNU Affero General Public License
24 # along with this program. If not, see <http://www.gnu.org/licenses/>.
27 import time, sys, os, shutil, subprocess, distutils.dir_util
28 sys.path.append("configuration")
30 if os.path.isfile("log.log"):
31 os.remove("log.log")
32 log = open("log.log", "w")
33 from scripts import *
34 from buildsite_local import *
35 from tools import *
37 sys.path.append(WorkspaceDirectory)
38 from projects import *
40 # Log error
41 printLog(log, "")
42 printLog(log, "-------")
43 printLog(log, "--- Install to client install")
44 printLog(log, "-------")
45 printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time())))
46 printLog(log, "")
48 for category in InstallClientData:
49 printLog(log, "CATEGORY " + category["Name"])
50 packExt = ".bnp"
51 if (category["StreamedPackages"]):
52 packExt = ".snp"
53 if (category["UnpackTo"] != None):
54 targetPath = ClientInstallDirectory
55 if (category["UnpackTo"] != ""):
56 targetPath += "/" + category["UnpackTo"]
57 mkPath(log, targetPath)
58 for package in category["Packages"]:
59 printLog(log, "PACKAGE " + package[0])
60 mkPath(log, InstallDirectory + "/" + package[0])
61 copyFilesNoTreeIfNeeded(log, InstallDirectory + "/" + package[0], targetPath)
62 else:
63 sourcePath = ClientPatchDirectory + "/bnp"
64 targetPath = ClientInstallDirectory + "/data"
65 mkPath(log, targetPath)
66 for package in category["Packages"]:
67 printLog(log, "PACKAGE " + package[0])
68 sourceBnp = sourcePath + "/" + package[0] + packExt
69 targetBnp = targetPath + "/" + package[0] + packExt
70 if (len(package[1]) > 0):
71 sourceBnp = sourcePath + "/" + package[1][0]
72 targetBnp = targetPath + "/" + package[1][0]
73 printLog(log, "TARGET " + package[1][0])
74 copyFileIfNeeded(log, sourceBnp, targetBnp)
75 for ref in category["Refs"]:
76 printLog(log, "REFERENCE " + ref)
77 sourceRef = sourcePath + "/" + ref + "_.ref"
78 targetRef = targetPath + "/" + ref + "_.ref"
79 copyFileIfNeeded(log, sourceRef, targetRef)
80 printLog(log, "")
82 log.close()
83 if os.path.isfile("d2_client_install.log"):
84 os.remove("d2_client_install.log")
85 shutil.copy("log.log", time.strftime("%Y-%m-%d-%H-%M-GMT", time.gmtime(time.time())) + "_client_install.log")
86 shutil.move("log.log", "d2_client_install.log")