summaryrefslogtreecommitdiff
path: root/build_files/patch-bazzite-os-branch-select.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build_files/patch-bazzite-os-branch-select.sh')
-rwxr-xr-xbuild_files/patch-bazzite-os-branch-select.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/build_files/patch-bazzite-os-branch-select.sh b/build_files/patch-bazzite-os-branch-select.sh
index 544b1a5..a360a2e 100755
--- a/build_files/patch-bazzite-os-branch-select.sh
+++ b/build_files/patch-bazzite-os-branch-select.sh
@@ -33,3 +33,26 @@ awk -v old="$old" '
install -m 0755 "$patched_file" "$file"
rm -f "$patched_file"
+
+# Match the channel names used by Bazzite's Game Mode announcement feeds.
+# Steam's rc/beta and bc/main aliases still select the same image branches.
+python3 - "$file" <<'PY'
+from pathlib import Path
+import sys
+
+path = Path(sys.argv[1])
+text = path.read_text()
+replacements = {
+ " testing)\n echo rc\n": " testing)\n echo beta\n",
+ " unstable)\n echo main\n": " unstable)\n echo preview\n",
+ " echo rc\n echo beta\n echo bc\n echo main\n":
+ " echo rc\n echo beta\n echo bc\n echo preview\n echo main\n",
+ " bc|main|unstable)\n": " bc|preview|main|unstable)\n",
+}
+for old in replacements:
+ if text.count(old) != 1:
+ raise SystemExit(f"Bazzite branch selector changed; expected exactly one {old!r}")
+for old, new in replacements.items():
+ text = text.replace(old, new, 1)
+path.write_text(text)
+PY