feat: OctoEverywhere for KIAUH v6 (#485)

* feat: scaffold OE installer

Signed-off-by: Dominik Willner <th33xitus@gmail.com>

* refactor: remove redundant steps ocoeverywhere already takes care of

Signed-off-by: Dominik Willner <th33xitus@gmail.com>

* refactor: add padding option to dialog

Signed-off-by: Dominik Willner <th33xitus@gmail.com>

* refactor: oe uninstaller

Signed-off-by: Dominik Willner <th33xitus@gmail.com>

* fix: add recursive removal of files

Signed-off-by: Dominik Willner <th33xitus@gmail.com>

* refactor: implement octoeverywhere update

Signed-off-by: Dominik Willner <th33xitus@gmail.com>

* chore: cleanup

Signed-off-by: Dominik Willner <th33xitus@gmail.com>

* chore: remove unused argument

Signed-off-by: Dominik Willner <th33xitus@gmail.com>

* fix: add instance names to blacklist

Signed-off-by: Dominik Willner <th33xitus@gmail.com>

* refactor: use update.sh script of OctoEverywhere for updating

Signed-off-by: Dominik Willner <th33xitus@gmail.com>

* fix: typo

Signed-off-by: Dominik Willner <th33xitus@gmail.com>

* refactor: add force flag to git_clone_wrapper

Signed-off-by: Dominik Willner <th33xitus@gmail.com>

---------

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
dw-0
2024-06-28 23:26:27 +02:00
committed by GitHub
parent dbe15e3a32
commit 103a7b61b3
21 changed files with 428 additions and 47 deletions

View File

@@ -59,9 +59,9 @@ def create_symlink(source: Path, target: Path, sudo=False) -> None:
raise
def remove_with_sudo(file_path: Path) -> None:
def remove_with_sudo(file: Path) -> None:
try:
cmd = ["sudo", "rm", "-f", file_path]
cmd = ["sudo", "rm", "-rf", file]
run(cmd, stderr=PIPE, check=True)
except CalledProcessError as e:
Logger.print_error(f"Failed to remove file: {e}")
@@ -79,6 +79,30 @@ def remove_file(file_path: Path, sudo=False) -> None:
raise
def run_remove_routines(file: Path) -> None:
try:
if not file.exists():
Logger.print_info(f"File '{file}' does not exist. Skipped ...")
return
if file.is_dir():
shutil.rmtree(file)
elif file.is_file():
file.unlink()
else:
raise OSError(f"File '{file}' is neither a file nor a directory!")
Logger.print_ok("Successfully removed!")
except OSError as e:
Logger.print_error(f"Unable to delete '{file}':\n{e}")
try:
Logger.print_info("Trying to remove with sudo ...")
remove_with_sudo(file)
Logger.print_ok("Successfully removed!")
except CalledProcessError as e:
Logger.print_error(f"Error deleting '{file}' with sudo:\n{e}")
Logger.print_error("Remove this directory manually!")
def unzip(filepath: Path, target_dir: Path) -> None:
"""
Helper function to unzip a zip-archive into a target directory |