mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-24 07:16:04 +00:00
fix(steam): Linux-only tools keep their native platform (#2313)
* fix(steam): reconcile tool dependencies by supported platform * fix(steam): refresh tool metadata and clear stale GE mappings * fix(steam): clear any Proton mapping from Linux-only tools * fix(steam): watch folders the client creates after the helper starts * Watch each missing directory level as it appears * Make the watcher level test wait on inotify readiness
This commit is contained in:
1 parent
92a7124589
commit
29823bb1bf
3 files changed
+273
-10
No files matched your search
@@ -734,6 +734,7 @@ def libraries(steam_root):
|
||||
|
||||
|
||||
def installed_apps(steam_root):
|
||||
entries = appinfo_entries(os.path.join(steam_root, "appcache", "appinfo.vdf"))
|
||||
apps = set()
|
||||
for library in libraries(steam_root):
|
||||
steamapps = os.path.join(library, "steamapps")
|
||||
@@ -743,7 +744,7 @@ def installed_apps(steam_root):
|
||||
continue
|
||||
for name in names:
|
||||
m = re.fullmatch(r"appmanifest_(\d+)\.acf", name)
|
||||
if m and m.group(1) not in NOT_GAMES:
|
||||
if m and m.group(1) not in NOT_GAMES and entries.get(m.group(1), {}).get("type") != "tool":
|
||||
apps.add(m.group(1))
|
||||
return sorted(apps, key=int)
|
||||
|
||||
@@ -927,6 +928,12 @@ def valve_picks(steam_root):
|
||||
return sorted(picks, key=int)
|
||||
|
||||
|
||||
def tool_platforms(steam_root):
|
||||
entries = appinfo_entries(os.path.join(steam_root, "appcache", "appinfo.vdf"))
|
||||
return {app: entry["oslist"] for app, entry in entries.items()
|
||||
if entry["type"] == "tool" and entry["oslist"] & {"linux", "windows"}}
|
||||
|
||||
|
||||
def native_targets(steam_root, apps):
|
||||
wanted = {str(app) for app in apps if str(app) not in NOT_GAMES}
|
||||
if not wanted:
|
||||
@@ -1064,10 +1071,11 @@ NATIVE_CHOICE = object()
|
||||
|
||||
|
||||
def plan_mapping(current, installed, runnable, default, auto, native=None, picks=(), overrides=None, managed=None,
|
||||
native_choices=()):
|
||||
native_choices=(), tools=None):
|
||||
tools = tools or {}
|
||||
runnable = {n.lower() for n in runnable}
|
||||
installed = set(installed)
|
||||
picks = set(picks)
|
||||
picks = set(picks) | {app for app, platforms in tools.items() if "linux" not in platforms}
|
||||
native = native or {}
|
||||
overrides = overrides or {}
|
||||
managed = set(auto) if managed is None else set(managed)
|
||||
@@ -1075,8 +1083,12 @@ def plan_mapping(current, installed, runnable, default, auto, native=None, picks
|
||||
changes, kept = {}, {}
|
||||
if current.get("0", "") != default:
|
||||
changes["0"] = default
|
||||
for app in sorted((set(current) | installed | picks | set(auto) | set(overrides) | native_choices) - {"0"}, key=app_order):
|
||||
for app in sorted((set(current) | installed | picks | set(auto) | set(overrides) | native_choices | set(tools)) - {"0"}, key=app_order):
|
||||
name = current.get(app, "")
|
||||
if app in tools and "linux" in tools[app] and "windows" not in tools[app]:
|
||||
if name and (name.lower() in runnable or "proton" in name.lower()):
|
||||
changes[app] = None
|
||||
continue
|
||||
if app in overrides:
|
||||
target = overrides[app]
|
||||
if target is DEFERRED_GAME_TOOL:
|
||||
@@ -1560,7 +1572,7 @@ def register_default(config_path, apps=(), protect=(), default=None, catalog=Non
|
||||
current.setdefault(app, "")
|
||||
changes, auto = plan_mapping(
|
||||
current, apps, names, default, followers(state, current), native, picks,
|
||||
overrides, managed, native_choices)
|
||||
overrides, managed, native_choices, tool_platforms(steam_root))
|
||||
set_mappings(tokens, mapping, changes)
|
||||
text = serialize(tokens)
|
||||
if text != serialize(tokenize(original)):
|
||||
|
||||
Reference in new issue
Block a user