Files
darling-lol/scripts/update.sh
T
lucannez64andClaude Opus 5.5 96da34a633 Add an update script that re-applies changed patches
After a pull that changed a patch, prepare.py stopped: the patch neither
applied nor reverse-applied to a tree holding its earlier version. Now
it looks for the earlier version applied in that component -- the copy
it records in build/applied-patches, or a version from this
repository's history -- reverts exactly it and applies the new one.
It never resets a repository; when nothing matches it stops and names
the repository with other edits, and it restores the earlier version
if the new one does not apply.

scripts/update.sh runs build.sh, the base install and
install-runtime.sh, and refuses to start while a Riot Client or League
process is open, since the install steps stop Darling.

Checked on a sandbox Indium checkout holding the previous patch: the
result matches a clean apply, a second run is a no-op, an unrelated
local edit survives and a conflicting one stops with the error.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 22:11:26 +02:00

30 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
# Bring an existing build and installation up to date after `git pull`: re-apply the patches that changed
# (prepare.py reverts the earlier version it finds applied), rebuild incrementally, and reinstall the base
# runtime and the per-user overrides. Run it with no Riot/League session open; it never stops one.
set -eu
repo=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
cd "$repo"
if [ ! -d build/darling-src/build ]; then
echo 'No existing build; follow the first-time setup in README.md instead.' >&2
exit 1
fi
# The install steps shut Darling down and stop leftover Riot processes, so refuse rather than end a session.
python3 - <<'PY'
from pathlib import Path
for entry in Path('/proc').iterdir():
if not entry.name.isdigit():
continue
try:
command_line = (entry / 'cmdline').read_bytes()
except OSError:
continue
if b'/Riot Client.app/' in command_line or b'/League of Legends.app/' in command_line:
raise SystemExit('A Riot Client or League process is running; exit the game and both clients, then run this again.')
PY
./scripts/build.sh
python3 build/runtime/tools/stop-darling-runtime.py
sudo cmake --install build/darling-src/build
./scripts/install-runtime.sh
echo 'Update installed. Start Darling with: sh scripts/run.sh'