fix(install): scoped keywords for zsh plugin lane

This commit is contained in:
Phoebus 2026-09-26 18:59:53 -07:00
parent 5ea4bb1885
commit ff104ddc49
2 changed files with 37 additions and 0 deletions

View file

@ -908,6 +908,23 @@ pub fn accept_keywords_mango() -> String {
o
}
/// The reviewed `~amd64` keyword set for the shell lane.
///
/// `app-shells/zsh` itself is stable; the packaged plugins
/// (`zsh-autosuggestions` proven `~amd64`-only in GURU by VM install run 3,
/// the other two scoped alongside it) ship testing-only. The login shell is
/// a base package, so these keywords are written with the base Portage
/// configuration whenever GURU is enabled — not only for the Mango profile.
/// This is NOT a global `~amd64` switch.
pub fn accept_keywords_shell() -> String {
let mut o = String::new();
o.push_str("# Zsh plugins: reviewed, scoped testing keywords (GURU ships these as ~amd64).\n");
o.push_str("app-shells/zsh-completions\n");
o.push_str("app-shells/zsh-autosuggestions\n");
o.push_str("app-shells/zsh-syntax-highlighting\n");
o
}
pub const BINHOST_OPENRC: &str =
"https://distfiles.gentoo.org/releases/amd64/binpackages/23.0/x86-64";
pub const BINHOST_HARDENED: &str =
@ -2532,6 +2549,21 @@ mod tests {
assert!(repos.contains("anongit.gentoo.org"));
}
#[test]
fn shell_keywords_are_scoped_not_global() {
let text = accept_keywords_shell();
for atom in [
"app-shells/zsh-completions",
"app-shells/zsh-autosuggestions",
"app-shells/zsh-syntax-highlighting",
] {
assert!(text.contains(atom), "missing {atom}");
}
assert!(!text.contains("*/*"));
assert!(!text.lines().any(|l| l.trim() == "~amd64"));
assert!(!text.contains("ACCEPT_KEYWORDS"));
}
#[test]
fn mango_session_contract() {
let script = PHOEBUS_MANGO_SESSION_SCRIPT;

View file

@ -41,6 +41,11 @@ pub fn write_config(exec: &Exec, config: &InstallConfig, hardware: &HardwareRepo
)?;
keywords.push('\n');
keywords.push_str(&sysgen::accept_keywords_mango());
// The login shell is a base package (validated by `users_configure`
// before the desktop stage); its GURU plugins need the same scoped
// keywords in the same condition.
keywords.push('\n');
keywords.push_str(&sysgen::accept_keywords_shell());
}
// Brave (stable only) via another-brave-overlay, scoped so unrelated
// packages cannot override Gentoo. The pin is written into the conf