Skip to content

Commit

Permalink
fixup umu-launcher character mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
GloriousEggroll committed Mar 21, 2024
1 parent 5221f56 commit 078726d
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 57 deletions.
6 changes: 3 additions & 3 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions umu/umu-launcher/compatibilitytool.vdf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
54 changes: 27 additions & 27 deletions umu/umu_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -256,25 +256,25 @@ 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",
)
continue

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()
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -555,41 +555,41 @@ 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",
)
continue

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()
Expand Down Expand Up @@ -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"}
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions umu/umu_test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
40 changes: 20 additions & 20 deletions umu/umu_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
)

Expand Down Expand Up @@ -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"
)

Expand Down

0 comments on commit 078726d

Please sign in to comment.