diff --git a/tools/make.py b/tools/make.py index eb2be34f2e..8b5a81383c 100644 --- a/tools/make.py +++ b/tools/make.py @@ -356,10 +356,15 @@ def copy_optionals_for_building(mod,pbos): #print ("Adding the following file: " + file_name) pbos.append(file_name) pbo_path = os.path.join(release_dir, "@ace","optionals",file_name) + sigFile_name = file_name +"."+ key_name + ".bisign" + sig_path = os.path.join(release_dir, "@ace","optionals",sigFile_name) if (os.path.isfile(pbo_path)): print("Moving " + pbo_path + " for processing.") shutil.move(pbo_path, os.path.join(release_dir,"@ace","addons",file_name)) - + + if (os.path.isfile(sig_path)): + #print("Moving " + sig_path + " for processing.") + shutil.move(sig_path, os.path.join(release_dir,"@ace","addons",sigFile_name)) except: print_error("Error in moving") raise @@ -407,9 +412,17 @@ def cleanup_optionals(mod): file_name = "ace_{}.pbo".format(dir_name) src_file_path = os.path.join(release_dir, "@ace","addons",file_name) dst_file_path = os.path.join(release_dir, "@ace","optionals",file_name) + + sigFile_name = file_name +"."+ key_name + ".bisign" + src_sig_path = os.path.join(release_dir, "@ace","addons",sigFile_name) + dst_sig_path = os.path.join(release_dir, "@ace","optionals",sigFile_name) + if (os.path.isfile(src_file_path)): #print("Preserving " + file_name) os.renames(src_file_path,dst_file_path) + if (os.path.isfile(src_sig_path)): + #print("Preserving " + sigFile_name) + os.renames(src_sig_path,dst_sig_path) except FileExistsError: print_error(file_name + " already exists") continue @@ -421,11 +434,10 @@ def cleanup_optionals(mod): def purge(dir, pattern, friendlyPattern="files"): - print_yellow("Deleting " + friendlyPattern + " files from directory: " + dir) + print_green("Deleting " + friendlyPattern + " files from directory: " + dir) for f in os.listdir(dir): if re.search(pattern, f): os.remove(os.path.join(dir, f)) - print_yellow("Deleting file => " + f) def build_signature_file(file_name): @@ -735,7 +747,7 @@ See the make.cfg file for additional build options. #We always build ACE_common so we can properly show the correct version stamp in the RPT file. if module == "common": - old_sha = "" + old_sha = old_sha # Hash the module new_sha = get_directory_hash(os.path.join(module_root, module)) @@ -743,11 +755,10 @@ See the make.cfg file for additional build options. # Is the pbo or sig file missing? missing = not os.path.isfile(os.path.join(release_dir, project, "addons", "ace_{}.pbo".format(module))) sigFile = pbo_name_prefix+module + ".pbo." + key_name + ".bisign" - print("Checking sig file => " + sigFile) sigMissing = not os.path.isfile(os.path.join(release_dir, project, "addons", sigFile )) if missing: - print("ace_{}.pbo".format(module) + " is missing. Building...") + print_yellow("Missing PBO file ace_{}.pbo".format(module) + ". Building...") # Check if it needs rebuilt # print ("Hash:", new_sha) @@ -756,7 +767,7 @@ See the make.cfg file for additional build options. print("Module has not changed.") if sigMissing: if key: - print_yellow("Signature key " + sigFile + " is missing.") + print_yellow("Missing Signature key " + sigFile) build_signature_file(os.path.join(module_root, release_dir, project, "Addons", pbo_name_prefix + module + ".pbo")) # Skip everything else continue @@ -1047,7 +1058,7 @@ See the make.cfg file for additional build options. print_error("Could not copy files. Is Arma 3 running?") copy_important_files(module_root_parent,os.path.join(release_dir, "@ace")) - cleanup_optionals(optionals_modules,optional_files) + cleanup_optionals(optionals_modules) if __name__ == "__main__":