-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use custom file lock functionality (#314)
* umu_util: add function to enable file locking * umu_proton: refactor file locking * umu_runtime: refactor file locking * umu_run: refactor file locking * pyproject: drop filelock dependency * requirements: drop filelock dependency * packaging: drop filelock dependency * umu_test: update tests to mock the context object * umu_runtime: don't create var in with statement * tests: add e2e test for file lock * workflows: add e2e file lock test * tests: shellcheck lint * tests: fix e2e test * tests: update file lock test * tests: update file lock test * tests: update file lock test * tests: update file lock test * tests: update file lock test * style: update name * chore: remove comment
- Loading branch information
Showing
14 changed files
with
115 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -246,7 +246,6 @@ parts: | |
plugin: nil | ||
stage-packages: | ||
- python3-xlib | ||
- python3-filelock | ||
prime: | ||
- usr/lib/python3 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
python-xlib>=0.33 | ||
filelock>=3.15.4 | ||
urllib3>=2.0.0,<3.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env sh | ||
|
||
# | ||
# Ensure umu-launcher does not download its fetched resources more than once | ||
# when multiple processes of itself are created | ||
# | ||
|
||
tmp1=$(mktemp) | ||
tmp2=$(mktemp) | ||
|
||
UMU_LOG=debug GAMEID=umu-0 "$HOME/.local/bin/umu-run" wineboot -u 2> "$tmp1" & | ||
sleep 1 | ||
UMU_LOG=debug GAMEID=umu-0 "$HOME/.local/bin/umu-run" wineboot -u 2> "$tmp2" & | ||
wait | ||
|
||
grep "exited with wait status" "$tmp1" && grep -E "exited with wait status" "$tmp2" | ||
|
||
# Ensure the 2nd proc didn't download the runtime | ||
grep -E "\(latest\), please wait..." "$tmp2" | ||
exit_code=$? | ||
if "$exit_code" -ne 0; then | ||
exit 1 | ||
fi | ||
|
||
# Ensure the 2nd proc didn't download Proton | ||
grep "Downloading" "$tmp2" | ||
exit_code=$? | ||
if "$exit_code" -ne 0; then | ||
exit 1 | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters