fix: wait before retrying a FEX build that did not install

A failed catalog install is retried after an hour or when the session names
another build, a missing updater falls back to the FEX already here, and the
archive download gives up on a stalled connection.
This commit is contained in:
maxjivi05 authored and MaxsTechReview committed 2026-10-26 13:40:36 -04:00
1 parent bb1cbf95c0
commit 4de4c65c2a
3 files changed
+44 -3

No files matched your search

@@ -11,6 +11,7 @@ import shutil
import struct
import subprocess
import sys
import time
HOME = os.environ.get("HOME") or "/root"
STEAM_ROOT = os.path.join(HOME, ".local", "share", "Steam")
@@ -160,9 +161,25 @@ def update_own_fex():
return
if (read_text(OWN_FEX_TAG) or "").strip() == wanted and os.access(os.path.join(OWN_FEX, "bin", "FEX"), os.X_OK):
return
failed = os.path.join(STATE, "update-failed")
try:
if (read_text(failed) or "").strip() == wanted and time.time() - os.path.getmtime(failed) < 3600:
return
except OSError:
pass
say("installing DroidDeck's FEX build %s" % wanted)
if subprocess.call([os.path.join(BIN_DIR, "droiddeck-fex-update")], stdout=sys.stderr) != 0:
say("DroidDeck's FEX build %s did not install; using the FEX already here" % wanted)
try:
code = subprocess.call([os.path.join(BIN_DIR, "droiddeck-fex-update")], stdout=sys.stderr)
except OSError:
code = 1
if code == 0:
with contextlib.suppress(OSError):
os.remove(failed)
return
with contextlib.suppress(OSError):
with open(failed, "w", encoding="utf-8") as handle:
handle.write(wanted + "\n")
say("DroidDeck's FEX build %s did not install; using the FEX already here" % wanted)
def fex_install():
@@ -19,7 +19,7 @@ fex_install() {
local tag=$1 sha=$2 urls=$3 dst=/ tmp u f
tmp=$(mktemp -d)
for u in $urls; do
curl -fsSL --retry 2 "$u" -o "$tmp/fex.tzst" && echo "$sha $tmp/fex.tzst" | sha256sum -c --quiet >/dev/null 2>&1 && break
curl -fsSL --retry 2 --connect-timeout 20 --speed-limit 1024 --speed-time 60 "$u" -o "$tmp/fex.tzst" && echo "$sha $tmp/fex.tzst" | sha256sum -c --quiet >/dev/null 2>&1 && break
rm -f "$tmp/fex.tzst"
done
if [ ! -s "$tmp/fex.tzst" ]; then