From 02580d510d0c0c0a8a45c89bea564d2995b92aaf Mon Sep 17 00:00:00 2001 From: jonpas Date: Fri, 22 May 2015 19:51:06 +0200 Subject: [PATCH 1/3] Added mainprefix and prefix variables Fixed prefix variable values --- tools/build.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/build.py b/tools/build.py index c6a425975e..e815dc9343 100644 --- a/tools/build.py +++ b/tools/build.py @@ -4,6 +4,10 @@ import os import sys import subprocess +######## GLOBALS ######### +mainprefix = "z" +prefix = "ace_" +########################## def mod_time(path): if not os.path.isdir(path): @@ -15,12 +19,12 @@ def mod_time(path): def check_for_changes(addonspath, module): - if not os.path.exists(os.path.join(addonspath, "ace_{}.pbo".format(module))): + if not os.path.exists(os.path.join(addonspath, prefix + module + ".pbo")): return True - return mod_time(os.path.join(addonspath, module)) > mod_time(os.path.join(addonspath, "ace_{}.pbo".format(module))) + return mod_time(os.path.join(addonspath, module)) > mod_time(os.path.join(addonspath, prefix + module + ".pbo")) def check_for_obsolete_pbos(addonspath, file): - module = file[4:-4] + module = file[len(prefix):-4] if not os.path.exists(os.path.join(addonspath, module)): return True return False @@ -68,9 +72,9 @@ def main(): subprocess.check_output([ "makepbo", "-NUP", - "-@=z\\addons\\ace\\{}".format(p), + "-@={}\\addons\\{}\\".format(mainprefix, prefix.rstrip("_")) + p, p, - "ace_{}.pbo".format(p) + prefix + p + ".pbo" ], stderr=subprocess.STDOUT) except: failed += 1 From defe3569402ce72ac81bdd522763b461d2d09437 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 23 May 2015 02:26:48 +0200 Subject: [PATCH 2/3] New-school .format, Fixed prefix --- tools/build.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/build.py b/tools/build.py index e815dc9343..d99a168dc9 100644 --- a/tools/build.py +++ b/tools/build.py @@ -19,9 +19,9 @@ def mod_time(path): def check_for_changes(addonspath, module): - if not os.path.exists(os.path.join(addonspath, prefix + module + ".pbo")): + if not os.path.exists(os.path.join(addonspath, "{}{}.pbo".format(prefix,module))): return True - return mod_time(os.path.join(addonspath, module)) > mod_time(os.path.join(addonspath, prefix + module + ".pbo")) + return mod_time(os.path.join(addonspath, module)) > mod_time(os.path.join(addonspath, "{}{}.pbo".format(prefix,module))) def check_for_obsolete_pbos(addonspath, file): module = file[len(prefix):-4] @@ -72,9 +72,9 @@ def main(): subprocess.check_output([ "makepbo", "-NUP", - "-@={}\\addons\\{}\\".format(mainprefix, prefix.rstrip("_")) + p, + "-@={}\\{}\\addons\\{}".format(mainprefix,prefix.rstrip("_"),p), p, - prefix + p + ".pbo" + "{}{}.pbo".format(prefix,p) ], stderr=subprocess.STDOUT) except: failed += 1 From 72abe20f583a8fe49f33aab3a822f188843780d6 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sun, 24 May 2015 22:07:12 +0200 Subject: [PATCH 3/3] Capitalized globals --- tools/build.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/build.py b/tools/build.py index d99a168dc9..716d4fb3a7 100644 --- a/tools/build.py +++ b/tools/build.py @@ -5,8 +5,8 @@ import sys import subprocess ######## GLOBALS ######### -mainprefix = "z" -prefix = "ace_" +MAINPREFIX = "z" +PREFIX = "ace_" ########################## def mod_time(path): @@ -19,12 +19,12 @@ def mod_time(path): def check_for_changes(addonspath, module): - if not os.path.exists(os.path.join(addonspath, "{}{}.pbo".format(prefix,module))): + if not os.path.exists(os.path.join(addonspath, "{}{}.pbo".format(PREFIX,module))): return True - return mod_time(os.path.join(addonspath, module)) > mod_time(os.path.join(addonspath, "{}{}.pbo".format(prefix,module))) + return mod_time(os.path.join(addonspath, module)) > mod_time(os.path.join(addonspath, "{}{}.pbo".format(PREFIX,module))) def check_for_obsolete_pbos(addonspath, file): - module = file[len(prefix):-4] + module = file[len(PREFIX):-4] if not os.path.exists(os.path.join(addonspath, module)): return True return False @@ -72,9 +72,9 @@ def main(): subprocess.check_output([ "makepbo", "-NUP", - "-@={}\\{}\\addons\\{}".format(mainprefix,prefix.rstrip("_"),p), + "-@={}\\{}\\addons\\{}".format(MAINPREFIX,PREFIX.rstrip("_"),p), p, - "{}{}.pbo".format(prefix,p) + "{}{}.pbo".format(PREFIX,p) ], stderr=subprocess.STDOUT) except: failed += 1