Fix undefined variable when make.py exits before builds, Rename aceVersion variable to project_version, Update regex search from CBA

This commit is contained in:
jonpas
2016-01-10 03:16:46 +01:00
parent 0397b3f9f4
commit d8853e327e

View File

@ -697,11 +697,9 @@ def version_stamp_pboprefix(module,commitID):
f.close() f.close()
if configtext: if configtext:
patchestext = re.search(r"version.*?=.*?$", configtext, re.DOTALL) if re.search(r"version=(.*?)$", configtext, re.DOTALL):
if patchestext:
if configtext: if configtext:
patchestext = re.search(r"(version.*?=)(.*?)$", configtext, re.DOTALL).group(1) configtext = re.sub(r"version=(.*?)$", "version={}\n".format(commitID), configtext, flags=re.DOTALL)
configtext = re.sub(r"version(.*?)=(.*?)$", "version = {}\n".format(commitID), configtext, flags=re.DOTALL)
f = open(configpath, "w") f = open(configpath, "w")
f.write(configtext) f.write(configtext)
f.close() f.close()
@ -975,17 +973,16 @@ See the make.cfg file for additional build options.
print ("No cache found.") print ("No cache found.")
cache = {} cache = {}
# Check the ace build version (from main) with cached version - Forces a full rebuild when version changes # Check the build version (from main) with cached version - forces a full rebuild when version changes
aceVersion = get_project_version() project_version = get_project_version()
cacheVersion = "None"; cacheVersion = "None";
if 'cacheVersion' in cache: if 'cacheVersion' in cache:
cacheVersion = cache['cacheVersion'] cacheVersion = cache['cacheVersion']
if (aceVersion != cacheVersion): if (project_version != cacheVersion):
cache = {} cache = {}
print("Reseting Cache {0} to New Version {1}".format(cacheVersion, aceVersion)) print("Reseting Cache {0} to New Version {1}".format(cacheVersion, project_version))
cache['cacheVersion'] = aceVersion cache['cacheVersion'] = project_version
if not os.path.isdir(os.path.join(release_dir, project, "addons")): if not os.path.isdir(os.path.join(release_dir, project, "addons")):
try: try:
@ -1011,6 +1008,9 @@ See the make.cfg file for additional build options.
set_version_in_files(); set_version_in_files();
print("Version in files has been changed, make sure you commit and push the updates!") print("Version in files has been changed, make sure you commit and push the updates!")
amountOfBuildsFailed = 0
namesOfBuildsFailed = []
try: try:
# Temporarily copy optionals_root for building. They will be removed later. # Temporarily copy optionals_root for building. They will be removed later.
optionals_modules = [] optionals_modules = []
@ -1095,9 +1095,6 @@ See the make.cfg file for additional build options.
print_error("\nFailed to delete {}".format(os.path.join(obsolete_check_path,file))) print_error("\nFailed to delete {}".format(os.path.join(obsolete_check_path,file)))
pass pass
amountOfBuildsFailed = 0
namesOfBuildsFailed = []
# For each module, prep files and then build. # For each module, prep files and then build.
print_blue("\nBuilding...") print_blue("\nBuilding...")
for module in modules: for module in modules: