From fc4a97f8cedcc87f03c0b0bd5d98cc1826aec2b1 Mon Sep 17 00:00:00 2001 From: Jacob Date: Sat, 14 Dec 2024 15:33:17 +0800 Subject: [PATCH 1/2] Fixed muOS support, small tweaks. --- PortMaster/PortMaster.sh | 2 +- PortMaster/mod_muOS.txt | 2 +- PortMaster/trimui/PortMaster.txt | 1 + PortMaster/utils/pmsplash.txt | 8 +++++--- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/PortMaster/PortMaster.sh b/PortMaster/PortMaster.sh index f20d7a3..4734d22 100755 --- a/PortMaster/PortMaster.sh +++ b/PortMaster/PortMaster.sh @@ -26,7 +26,7 @@ CUR_TTY=/dev/tty0 cd "$controlfolder" -exec > >(tee "$controlfolder/log.txt") 2>&1 +> "$controlfolder/log.txt" && exec > >(tee "$controlfolder/log.txt") 2>&1 export TERM=linux $ESUDO chmod 666 $CUR_TTY diff --git a/PortMaster/mod_muOS.txt b/PortMaster/mod_muOS.txt index d69f57d..9d07240 100644 --- a/PortMaster/mod_muOS.txt +++ b/PortMaster/mod_muOS.txt @@ -20,5 +20,5 @@ GODOT_OPTS="--resolution ${DISPLAY_WIDTH}x${DISPLAY_HEIGHT} -f" pm_platform_helper() { # Help keep XongleBongles sanity below - printf "%s" "$(basename "$0")" > /run/muos/system/foreground_process + printf "%s" "$(basename "$1")" > /run/muos/system/foreground_process } diff --git a/PortMaster/trimui/PortMaster.txt b/PortMaster/trimui/PortMaster.txt index 24887d8..1521443 100644 --- a/PortMaster/trimui/PortMaster.txt +++ b/PortMaster/trimui/PortMaster.txt @@ -102,6 +102,7 @@ echo "Starting PortMaster." > $CUR_TTY chmod -R +x . rm -f "$controlfolder/.pugwash-reboot" +printf "\033c" > $CUR_TTY while true; do ./pugwash --debug diff --git a/PortMaster/utils/pmsplash.txt b/PortMaster/utils/pmsplash.txt index ee1fee4..d9ea8c3 100644 --- a/PortMaster/utils/pmsplash.txt +++ b/PortMaster/utils/pmsplash.txt @@ -6,11 +6,13 @@ # Source love2d runtime source $controlfolder/runtimes/"love_11.5"/love.txt +# SO IT CAN BE STOPPED, MUAHAHAHAHAHA +export PMSPLASH_STOP="$controlfolder/utils/pmsplash/stopsplash" + +[ -f "$PMSPLASH_STOP" ] && $ESUDO rm -f "$PMSPLASH_STOP" + # Run the splash $LOVE_RUN "$controlfolder/utils/pmsplash" & # So it can be waited. export PMSPLASH_PID=$! - -# SO IT CAN BE STOPPED, MUAHAHAHAHAHA -export PMSPLASH_STOP="$controlfolder/utils/pmsplash/stopsplash" From 77198475fcdf2f1e55da58ed58b55fe1a2d33328 Mon Sep 17 00:00:00 2001 From: Jacob Date: Sat, 14 Dec 2024 16:38:49 +0800 Subject: [PATCH 2/2] Fixed ArkOS installer bug. --- PortMaster/pugwash | 6 +++++- PortMaster/pylibs/harbourmaster/harbour.py | 2 +- PortMaster/pylibs/harbourmaster/platform.py | 23 +++++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/PortMaster/pugwash b/PortMaster/pugwash index c0bc282..f7a6da5 100755 --- a/PortMaster/pugwash +++ b/PortMaster/pugwash @@ -624,7 +624,7 @@ class PortMasterGUI(pySDL2gui.GUI, harbourmaster.Callback): if not is_process_running(f"love.{capabilities['primary_arch']}"): break - sdl2.SDL_Delay(500) + sdl2.SDL_Delay(100) if is_process_running(f"love.{capabilities['primary_arch']}"): subprocess.check_output(["pkill", "-f", f"love.{capabilities['primary_arch']}"]) @@ -641,6 +641,10 @@ class PortMasterGUI(pySDL2gui.GUI, harbourmaster.Callback): sdl2.SDL_SetHint(sdl2.SDL_HINT_RENDER_SCALE_QUALITY, b"2") + # Quickly present something, helps on ArkOS. + renderer.clear() + renderer.present() + self.text_data = {} self.changed_keys = set() formatter = StringFormatter(self.text_data) diff --git a/PortMaster/pylibs/harbourmaster/harbour.py b/PortMaster/pylibs/harbourmaster/harbour.py index d94c7a6..ee6ced5 100644 --- a/PortMaster/pylibs/harbourmaster/harbour.py +++ b/PortMaster/pylibs/harbourmaster/harbour.py @@ -1416,7 +1416,7 @@ def _install_portmaster(self, download_file, do_delete=False): if move_bash and dest_file.name.lower().endswith('.sh'): move_bash_dir = self.platform.MOVE_PM_BASH_DIR if move_bash_dir is None or not move_bash_dir.is_dir(): - move_bash_dir = self.ports_dir + move_bash_dir = self.tools_dir self.callback.message(f"- moving {dest_file} to {move_bash_dir / dest_file.name}") shutil.move(dest_file, move_bash_dir / dest_file.name) diff --git a/PortMaster/pylibs/harbourmaster/platform.py b/PortMaster/pylibs/harbourmaster/platform.py index fd6d13a..aa21a7d 100755 --- a/PortMaster/pylibs/harbourmaster/platform.py +++ b/PortMaster/pylibs/harbourmaster/platform.py @@ -439,6 +439,29 @@ class PlatformArkOS(PlatformGCD_PortMaster, PlatformBase): MOVE_PM_BASH = True ES_NAME = 'emulationstation' + def __init__(self, hm): + super().__init__(hm) + + # Fix a whoopsie :D + BAD_SCRIPT = self.hm.ports_dir / "PortMaster.sh" + GOOD_SCRIPT = self.hm.tools_dir / "PortMaster.sh" + + if not BAD_SCRIPT.is_file(): + return + + if not GOOD_SCRIPT.is_file(): + logger.info(f"MV: {BAD_SCRIPT} -> {GOOD_SCRIPT}") + shutil.move(BAD_SCRIPT, GOOD_SCRIPT) + return + + if "pmsplash" not in GOOD_SCRIPT.read_text(): + logger.info(f"MV: {BAD_SCRIPT} -> {GOOD_SCRIPT}") + shutil.move(BAD_SCRIPT, GOOD_SCRIPT) + return + + logger.info(f"RM: {BAD_SCRIPT}") + BAD_SCRIPT.unlink() + def gamelist_file(self): return self.hm.ports_dir / 'gamelist.xml'