From d0793b2e6bd6c2efe5d6d1ddb2ec7e8e9930f281 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 30 Jul 2014 21:47:48 +0200 Subject: [PATCH] Bugfix --- .../build_gamedata/configuration/scripts.py | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/code/nel/tools/build_gamedata/configuration/scripts.py b/code/nel/tools/build_gamedata/configuration/scripts.py index 6bd4e00dc..02f13139c 100755 --- a/code/nel/tools/build_gamedata/configuration/scripts.py +++ b/code/nel/tools/build_gamedata/configuration/scripts.py @@ -369,7 +369,29 @@ def needUpdateDirByTagLogFiltered(log, dir_source, ext_source, dir_dest, ext_des return 0 def needUpdateDirByTagLog(log, dir_source, ext_source, dir_dest, ext_dest): - needUpdateDirByTagLogFiltered(log, dir_source, ext_source, dir_dest, ext_dest, [ ]) + updateCount = 0 + skipCount = 0 + lenSrcExt = len(ext_source) + sourceFiles = findFilesNoSubdir(log, dir_source, ext_source) + destFiles = findFilesNoSubdir(log, dir_dest, ext_dest) + for file in sourceFiles: + sourceFile = dir_source + "/" + file + tagFile = dir_dest + "/" + file[0:-lenSrcExt] + ext_dest + if os.path.isfile(tagFile): + sourceTime = os.stat(sourceFile).st_mtime + tagTime = os.stat(tagFile).st_mtime + if (sourceTime > tagTime): + updateCount = updateCount + 1 + else: + skipCount = skipCount + 1 + else: + updateCount = updateCount + 1 + if updateCount > 0: + printLog(log, "UPDATE " + str(updateCount) + " / " + str(len(sourceFiles)) + "; SKIP " + str(skipCount) + " / " + str(len(sourceFiles)) + "; DEST " + str(len(destFiles))) + return 1 + else: + printLog(log, "SKIP " + str(skipCount) + " / " + str(len(sourceFiles)) + "; DEST " + str(len(destFiles))) + return 0 def needUpdateDirNoSubdirFile(log, dir_source, file_dest): if not os.path.isfile(file_dest):