mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #845 from acemod/removeObsoletePBOs
Remove obsolete PBOs
This commit is contained in:
commit
393d7b330e
@ -309,12 +309,12 @@ def copy_important_files(source_dir,destination_dir):
|
|||||||
"logo_ace3_ca.paa"
|
"logo_ace3_ca.paa"
|
||||||
]
|
]
|
||||||
|
|
||||||
print_yellow ("source_dir: " + source_dir)
|
|
||||||
print_yellow("destination_dir: " + destination_dir)
|
|
||||||
|
|
||||||
#copy importantFiles
|
#copy importantFiles
|
||||||
try:
|
try:
|
||||||
print_blue("\nSearching for important files in " + source_dir)
|
print_blue("\nSearching for important files in " + source_dir)
|
||||||
|
print("Source_dir: " + source_dir)
|
||||||
|
print("Destination_dir: " + destination_dir)
|
||||||
|
|
||||||
for file in importantFiles:
|
for file in importantFiles:
|
||||||
print_green("Copying file => " + os.path.join(source_dir,file))
|
print_green("Copying file => " + os.path.join(source_dir,file))
|
||||||
shutil.copyfile(os.path.join(source_dir,file),os.path.join(destination_dir,file))
|
shutil.copyfile(os.path.join(source_dir,file),os.path.join(destination_dir,file))
|
||||||
@ -449,6 +449,13 @@ def build_signature_file(file_name):
|
|||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def check_for_obsolete_pbos(addonspath, file):
|
||||||
|
module = file[4:-4]
|
||||||
|
if not os.path.exists(os.path.join(addonspath, module)):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
|
||||||
@ -759,6 +766,15 @@ See the make.cfg file for additional build options.
|
|||||||
|
|
||||||
key = os.path.join(private_key_path, key_name + ".biprivatekey")
|
key = os.path.join(private_key_path, key_name + ".biprivatekey")
|
||||||
|
|
||||||
|
# Remove any obsolete files.
|
||||||
|
print_blue("\nChecking for obsolete files...")
|
||||||
|
obsolete_check_path = os.path.join(module_root, release_dir, project,"addons")
|
||||||
|
for file in os.listdir(obsolete_check_path):
|
||||||
|
if (file.endswith(".pbo") and os.path.isfile(os.path.join(obsolete_check_path,file))):
|
||||||
|
if check_for_obsolete_pbos(module_root, file):
|
||||||
|
fileName = os.path.splitext(file)[0]
|
||||||
|
print_yellow("Removing obsolete file => " + file)
|
||||||
|
purge(obsolete_check_path,fileName+"\..",fileName+".*")
|
||||||
|
|
||||||
# For each module, prep files and then build.
|
# For each module, prep files and then build.
|
||||||
print_blue("\nBuilding...")
|
print_blue("\nBuilding...")
|
||||||
@ -1044,8 +1060,6 @@ See the make.cfg file for additional build options.
|
|||||||
except:
|
except:
|
||||||
print_error("ERROR: Could not delete pboProject temp files.")
|
print_error("ERROR: Could not delete pboProject temp files.")
|
||||||
|
|
||||||
print_green("\nDone.")
|
|
||||||
|
|
||||||
copy_important_files(module_root_parent,os.path.join(release_dir, "@ace"))
|
copy_important_files(module_root_parent,os.path.join(release_dir, "@ace"))
|
||||||
cleanup_optionals(optionals_modules)
|
cleanup_optionals(optionals_modules)
|
||||||
|
|
||||||
@ -1087,6 +1101,9 @@ See the make.cfg file for additional build options.
|
|||||||
shutil.copytree(os.path.join(module_root, release_dir, project), os.path.join(a3_path, project))
|
shutil.copytree(os.path.join(module_root, release_dir, project), os.path.join(a3_path, project))
|
||||||
except:
|
except:
|
||||||
print_error("Could not copy files. Is Arma 3 running?")
|
print_error("Could not copy files. Is Arma 3 running?")
|
||||||
|
|
||||||
|
print_green("\nDone.")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main(sys.argv)
|
main(sys.argv)
|
||||||
|
Loading…
Reference in New Issue
Block a user