From 078726dd45146c89fbe0eed8b0ef25bfe4a1d6b6 Mon Sep 17 00:00:00 2001 From: GloriousEggroll Date: Wed, 20 Mar 2024 21:06:21 -0600 Subject: [PATCH] fixup umu-launcher character mismatch --- Makefile.in | 6 +-- README.md | 2 +- umu/umu-launcher/compatibilitytool.vdf | 4 +- umu/umu_test.py | 54 +++++++++++++------------- umu/umu_test_plugins.py | 8 ++-- umu/umu_util.py | 40 +++++++++---------- 6 files changed, 57 insertions(+), 57 deletions(-) diff --git a/Makefile.in b/Makefile.in index ba60c3596..0c4148218 100644 --- a/Makefile.in +++ b/Makefile.in @@ -95,14 +95,14 @@ $(OBJDIR)/.build-umu-launcher: | $(OBJDIR) umu-launcher: $(OBJDIR)/.build-umu-launcher umu-launcher-bin-install: umu-launcher - install -d $(DESTDIR)$(DATADIR)/$(INSTALLDIR)/umu-Launcher + install -d $(DESTDIR)$(DATADIR)/$(INSTALLDIR)/umu-launcher install -Dm 755 $(OBJDIR)/$(<)-run $(DESTDIR)$(DATADIR)/$(INSTALLDIR)/umu-launcher/umu-run umu-launcher-dist-install: $(info :: Installing umu-launcher ) install -d $(DESTDIR)$(DATADIR)/$(INSTALLDIR)/umu-launcher - install -Dm 644 umu/umu-launcher/compatibilitytool.vdf -t $(DESTDIR)$(DATADIR)/$(INSTALLDIR)/umu-Launcher - install -Dm 644 umu/umu-launcher/toolmanifest.vdf -t $(DESTDIR)$(DATADIR)/$(INSTALLDIR)/umu-Launcher + install -Dm 644 umu/umu-launcher/compatibilitytool.vdf -t $(DESTDIR)$(DATADIR)/$(INSTALLDIR)/umu-launcher + install -Dm 644 umu/umu-launcher/toolmanifest.vdf -t $(DESTDIR)$(DATADIR)/$(INSTALLDIR)/umu-launcher #umu-launcher-install: umu-launcher-dist-install umu-launcher-bin-install umu-launcher-install: umu-launcher-dist-install diff --git a/README.md b/README.md index 753924e0f..5b7bd0e3a 100755 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ Building umu currently requires `bash`, `make`, `meson` and `scdoc` To build umu, after downloading and extracting the source code from this repository, change into the newly extracted directory ```shell -cd umu-Launcher +cd umu-launcher ``` To configure the installation `PREFIX` (this is not related to wine's `WINEPREFIX`) use the `configure.sh` script diff --git a/umu/umu-launcher/compatibilitytool.vdf b/umu/umu-launcher/compatibilitytool.vdf index f79a2213e..c78b371b7 100644 --- a/umu/umu-launcher/compatibilitytool.vdf +++ b/umu/umu-launcher/compatibilitytool.vdf @@ -2,10 +2,10 @@ { "compat_tools" { - "umu-Launcher" // Internal name of this tool + "umu-launcher" // Internal name of this tool { "install_path" "." - "display_name" "umu-Launcher" + "display_name" "umu-launcher" "from_oslist" "windows" "to_oslist" "linux" } diff --git a/umu/umu_test.py b/umu/umu_test.py index f8e2a6c13..d12053e06 100644 --- a/umu/umu_test.py +++ b/umu/umu_test.py @@ -112,10 +112,10 @@ def setUp(self): Path(self.test_user_share, "pressure-vessel").mkdir() Path(self.test_user_share, "pressure-vessel", "foo").touch() - # Mock umu-Launcher - Path(self.test_user_share, "umu-Launcher").mkdir() - Path(self.test_user_share, "umu-Launcher", "compatibilitytool.vdf").touch() - Path(self.test_user_share, "umu-Launcher", "toolmanifest.vdf").touch() + # Mock umu-launcher + Path(self.test_user_share, "umu-launcher").mkdir() + Path(self.test_user_share, "umu-launcher", "compatibilitytool.vdf").touch() + Path(self.test_user_share, "umu-launcher", "toolmanifest.vdf").touch() # Mock Reaper Path(self.test_user_share, "reaper").touch() @@ -256,17 +256,17 @@ def test_update_umu_empty(self): # Runner self.assertTrue( - self.test_compat.joinpath("umu-Launcher").is_dir(), - "Expected umu-Launcher in compat", + self.test_compat.joinpath("umu-launcher").is_dir(), + "Expected umu-launcher in compat", ) - for file in self.test_compat.joinpath("umu-Launcher").glob("*"): + for file in self.test_compat.joinpath("umu-launcher").glob("*"): src = b"" dst = b"" if file.name == "umu-run": self.assertEqual( - self.test_compat.joinpath("umu-Launcher", "umu-run").readlink(), + self.test_compat.joinpath("umu-launcher", "umu-run").readlink(), Path("../../../umu/umu_run.py"), "Expected both symlinks to point to same dest", ) @@ -274,7 +274,7 @@ def test_update_umu_empty(self): with file.open(mode="rb") as filer: dst = filer.read() - with self.test_user_share.joinpath("umu-Launcher", file.name).open( + with self.test_user_share.joinpath("umu-launcher", file.name).open( mode="rb" ) as filer: src = filer.read() @@ -455,8 +455,8 @@ def test_update_umu(self): self.test_local_share.joinpath("pressure-vessel").mkdir() self.test_local_share.joinpath("pressure-vessel", "bar").touch() - # Mock umu-Launcher - self.test_compat.joinpath("umu-Launcher").mkdir() + # Mock umu-launcher + self.test_compat.joinpath("umu-launcher").mkdir() for file in runner_files: if file == "umu-run": self.test_compat.joinpath("umu-run").symlink_to("../../../umu_run.py") @@ -555,33 +555,33 @@ def test_update_umu(self): # Runner # The hashes should be compared because we written data in the mocked files self.assertTrue( - self.test_compat.joinpath("umu-Launcher").is_dir(), - "Expected umu-Launcher in compat", + self.test_compat.joinpath("umu-launcher").is_dir(), + "Expected umu-launcher in compat", ) - # Verify the count for .local/share/Steam/umu-Launcher + # Verify the count for .local/share/Steam/umu-launcher num_share = len( - [file for file in self.test_user_share.joinpath("umu-Launcher").glob("*")] + [file for file in self.test_user_share.joinpath("umu-launcher").glob("*")] ) num_local = len( - [file for file in self.test_compat.joinpath("umu-Launcher").glob("*")] + [file for file in self.test_compat.joinpath("umu-launcher").glob("*")] ) # Subtract one because a symbolic link is dynamically created self.assertEqual( num_share, num_local - 1, - "Expected .local/share/Steam/compatibilitytools.d/umu-Launcher" - "and /usr/share/umu/umu-Launcher to contain same files", + "Expected .local/share/Steam/compatibilitytools.d/umu-launcher" + "and /usr/share/umu/umu-launcher to contain same files", ) - for file in self.test_compat.joinpath("umu-Launcher").glob("*"): + for file in self.test_compat.joinpath("umu-launcher").glob("*"): src = b"" dst = b"" if file.name == "umu-run": self.assertEqual( - self.test_compat.joinpath("umu-Launcher", "umu-run").readlink(), + self.test_compat.joinpath("umu-launcher", "umu-run").readlink(), Path("../../../umu/umu_run.py"), "Expected both symlinks to point to same dest", ) @@ -589,7 +589,7 @@ def test_update_umu(self): with file.open(mode="rb") as filer: dst = filer.read() - with self.test_user_share.joinpath("umu-Launcher", file.name).open( + with self.test_user_share.joinpath("umu-launcher", file.name).open( mode="rb" ) as filer: src = filer.read() @@ -672,9 +672,9 @@ def test_install_umu(self): This function is expected to be run when ~/.local/share/umu is empty The contents of ~/.local/share/umu should be nearly identical to - /usr/share/umu, with the exception of the umu-Launcher files + /usr/share/umu, with the exception of the umu-launcher files - umu-Launcher is expected to be copied to compatibilitytools.d + umu-launcher is expected to be copied to compatibilitytools.d """ result = None runner_files = {"compatibilitytool.vdf", "toolmanifest.vdf", "umu-run"} @@ -725,12 +725,12 @@ def test_install_umu(self): "Expected umu_version.json to exist", ) - # umu-Launcher + # umu-launcher self.assertTrue( - Path(self.test_user_share, "umu-Launcher").is_dir(), - "Expected umu-Launcher to exist", + Path(self.test_user_share, "umu-launcher").is_dir(), + "Expected umu-launcher to exist", ) - for file in Path(self.test_compat, "umu-Launcher").glob("*"): + for file in Path(self.test_compat, "umu-launcher").glob("*"): if file.name not in runner_files: err = "A non-runner file was copied" raise AssertionError(err) diff --git a/umu/umu_test_plugins.py b/umu/umu_test_plugins.py index 3ebef52ce..275bed43a 100644 --- a/umu/umu_test_plugins.py +++ b/umu/umu_test_plugins.py @@ -111,10 +111,10 @@ def setUp(self): Path(self.test_user_share, "pressure-vessel").mkdir() Path(self.test_user_share, "pressure-vessel", "foo").touch() - # Mock umu-Launcher - Path(self.test_user_share, "umu-Launcher").mkdir() - Path(self.test_user_share, "umu-Launcher", "compatibilitytool.vdf").touch() - Path(self.test_user_share, "umu-Launcher", "toolmanifest.vdf").touch() + # Mock umu-launcher + Path(self.test_user_share, "umu-launcher").mkdir() + Path(self.test_user_share, "umu-launcher", "compatibilitytool.vdf").touch() + Path(self.test_user_share, "umu-launcher", "toolmanifest.vdf").touch() # Mock Reaper Path(self.test_user_share, "reaper").touch() diff --git a/umu/umu_util.py b/umu/umu_util.py index 523eeccc0..b5fddb0fd 100644 --- a/umu/umu_util.py +++ b/umu/umu_util.py @@ -180,8 +180,8 @@ def setup_umu(root: Path, local: Path) -> None: Performs full copies of tools on new installs and selectively on new updates The tools that will be copied are: - Pressure Vessel, Reaper, SteamRT, ULWLG launcher and the umu-Launcher - The umu-Launcher will be copied to .local/share/Steam/compatibilitytools.d + Pressure Vessel, Reaper, SteamRT, ULWLG launcher and the umu-launcher + The umu-launcher will be copied to .local/share/Steam/compatibilitytools.d """ log.debug("Root: %s", root) log.debug("Local: %s", local) @@ -215,7 +215,7 @@ def _install_umu( ~/.local/share/umu, ~/.local/share/Steam/compatibilitytools.d The tools that will be copied are: - SteamRT, Pressure Vessel, umu-Launcher, umu Launcher files, Reaper + SteamRT, Pressure Vessel, umu-launcher, umu Launcher files, Reaper and umu_version.json """ thread: Thread = None @@ -247,20 +247,20 @@ def _install_umu( # Runner steam_compat.mkdir(parents=True, exist_ok=True) - log.console(f"Copying umu-Launcher -> {steam_compat} ...") + log.console(f"Copying umu-launcher -> {steam_compat} ...") # Remove existing files if they exist -- this is a clean install. - if steam_compat.joinpath("umu-Launcher").is_dir(): - rmtree(steam_compat.joinpath("umu-Launcher").as_posix()) + if steam_compat.joinpath("umu-launcher").is_dir(): + rmtree(steam_compat.joinpath("umu-launcher").as_posix()) copytree( - root.joinpath("umu-Launcher"), - steam_compat.joinpath("umu-Launcher"), + root.joinpath("umu-launcher"), + steam_compat.joinpath("umu-launcher"), dirs_exist_ok=True, symlinks=True, ) - steam_compat.joinpath("umu-Launcher", "umu-run").symlink_to( + steam_compat.joinpath("umu-launcher", "umu-run").symlink_to( "../../../umu/umu_run.py" ) @@ -384,33 +384,33 @@ def _update_umu( runner: str = json_local["umu"]["versions"]["runner"] # Directory is absent - if not steam_compat.joinpath("umu-Launcher").is_dir(): - log.warning("umu-Launcher not found") + if not steam_compat.joinpath("umu-launcher").is_dir(): + log.warning("umu-launcher not found") copytree( - root.joinpath("umu-Launcher"), - steam_compat.joinpath("umu-Launcher"), + root.joinpath("umu-launcher"), + steam_compat.joinpath("umu-launcher"), dirs_exist_ok=True, symlinks=True, ) - steam_compat.joinpath("umu-Launcher", "umu-run").symlink_to( + steam_compat.joinpath("umu-launcher", "umu-run").symlink_to( "../../../umu/umu_run.py" ) - log.console(f"Restored umu-Launcher to {val}") - elif steam_compat.joinpath("umu-Launcher").is_dir() and val != runner: + log.console(f"Restored umu-launcher to {val}") + elif steam_compat.joinpath("umu-launcher").is_dir() and val != runner: # Update log.console(f"Updating {key} to {val}") - rmtree(steam_compat.joinpath("umu-Launcher").as_posix()) + rmtree(steam_compat.joinpath("umu-launcher").as_posix()) copytree( - root.joinpath("umu-Launcher"), - steam_compat.joinpath("umu-Launcher"), + root.joinpath("umu-launcher"), + steam_compat.joinpath("umu-launcher"), dirs_exist_ok=True, symlinks=True, ) - steam_compat.joinpath("umu-Launcher", "umu-run").symlink_to( + steam_compat.joinpath("umu-launcher", "umu-run").symlink_to( "../../../umu/umu_run.py" )