From 6eb4036c22ea07c1c04eca1808a7e18907a69e84 Mon Sep 17 00:00:00 2001 From: Phoebus Date: Mon, 21 Sep 2026 03:53:20 -0700 Subject: [PATCH] fix(mango): do not auto-sync GURU before git; verify the shell started - Write guru.conf with auto-sync = no so the first emerge --sync (before dev-vcs/git exists) only syncs the main tree; GURU is synced explicitly. - In the Mango session, check dms.service is active after starting mango-session.target and fall back to a direct 'dms run' if not. --- .../crates/phoebus-core/src/system.rs | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/installer-rs/crates/phoebus-core/src/system.rs b/installer-rs/crates/phoebus-core/src/system.rs index 6012167..50672cf 100644 --- a/installer-rs/crates/phoebus-core/src/system.rs +++ b/installer-rs/crates/phoebus-core/src/system.rs @@ -251,7 +251,10 @@ pub fn guru_repos_conf() -> String { o.push_str("location = /var/db/repos/guru\n"); o.push_str("sync-type = git\n"); o.push_str(&format!("sync-uri = {GURU_REPO_URI}\n")); - o.push_str("auto-sync = yes\n"); + // GURU is git-only and git is not installed yet during the first + // `emerge --sync`; syncing it explicitly after installing git keeps the + // initial main-tree sync from failing. + o.push_str("auto-sync = no\n"); o } @@ -774,14 +777,19 @@ if command -v dbus-update-activation-environment >/dev/null 2>&1; then QT_QPA_PLATFORM >/dev/null 2>&1 || true fi -# Exactly one shell: DMS, bound to mango-session.target. Fall back to a direct -# `dms run` only when the user manager is unavailable. +# Exactly one shell: DMS, bound to mango-session.target. Verify it actually +# started and fall back to a direct `dms run` if the user manager did not. +started=0 if command -v systemctl >/dev/null 2>&1 \ && systemctl --user start mango-session.target >/dev/null 2>&1; then - : -elif command -v dms >/dev/null 2>&1; then + sleep 0.5 + if systemctl --user is-active --quiet dms.service 2>/dev/null; then + started=1 + fi +fi +if [ "$started" = 0 ] && command -v dms >/dev/null 2>&1; then start_helper dms run -else +elif [ "$started" = 0 ]; then echo "phoebus-session-mango: dms not found; the shell will not start" >&2 fi