From a44bcad8e90baa68eaf25dab39c81fea6c431262 Mon Sep 17 00:00:00 2001 From: Slluxx Date: Wed, 3 Feb 2021 01:56:31 +0100 Subject: [PATCH] Automatically remove boo2.flag's except atmosphere and tesla. --- modules/basemodule.py | 12 ++++++++++++ modules/deepseacleaner.py | 6 ++++++ modules/emuiibo.py | 1 + 3 files changed, 19 insertions(+) diff --git a/modules/basemodule.py b/modules/basemodule.py index b361741..3629ac4 100644 --- a/modules/basemodule.py +++ b/modules/basemodule.py @@ -7,6 +7,7 @@ import zipfile import shutil import argparse +import glob parser = argparse.ArgumentParser(description="TeamNeptune's DeepSea build script.") requiredNamed = parser.add_argument_group('Options required to build a release candidate') @@ -85,6 +86,16 @@ def removeFile(self, filepath): if os.path.exists(filepath): os.remove(filepath) + def findAndRemove(self, filename): + if self.__module__ != "modules.atmosphere" or self.__module__ != "modules.ovlloader": + search = Path.joinpath(self.workspaceFullPath, "**", filename) + fileList = glob.glob(str(search), recursive=True) + for filePath in fileList: + try: + os.remove(filePath) + except: + pass + def copyFolderContentToPackage(self, source_dir, target_dir=""): if source_dir is None: return None @@ -96,4 +107,5 @@ def handleModule(self): release = self.getLatestRelease() assetName = self.downloadAsset(release) extracted = self.unpackAsset(assetName) + self.findAndRemove("boot2.flag") self.copyFolderContentToPackage(extracted) \ No newline at end of file diff --git a/modules/deepseacleaner.py b/modules/deepseacleaner.py index 95b8714..f8ce94d 100644 --- a/modules/deepseacleaner.py +++ b/modules/deepseacleaner.py @@ -12,6 +12,12 @@ class Deepseacleaner(Basemodule): def __init__(self, config): Basemodule.__init__(self, config) + + def handleModule(self): + release = self.getLatestRelease() + assetName = self.downloadAsset(release) + extracted = self.unpackAsset(assetName) + self.copyFolderContentToPackage(extracted) package = Deepseacleaner(config) \ No newline at end of file diff --git a/modules/emuiibo.py b/modules/emuiibo.py index 84c0b30..38f926c 100644 --- a/modules/emuiibo.py +++ b/modules/emuiibo.py @@ -18,6 +18,7 @@ def handleModule(self): assetName = self.downloadAsset(release) extracted = self.unpackAsset(assetName) extracted = Path.joinpath(extracted, "SdOut") + self.findAndRemove("boot2.flag") self.copyFolderContentToPackage(extracted) package = Emuiibo(config) \ No newline at end of file