Auto-detect CI/TUI mode for non-interactive environments and improve patch application robustness

- apply-patches.sh: add signature-marker checks for build-system patches
  to handle cases where reverse-check fails but patch is already applied
- test-baremetal.sh: auto-disable TUI when stdout is not a terminal;
  pass CI=1 to make
- test-live-iso-qemu.sh: pass CI=1 via env to prevent repo cook panic
- scripts/run.sh: auto-disable TUI when stdout is not a terminal;
  pass CI=1 to qemu launch
- repo.rs: improve TUI initialization error messages (raw mode + alternate
  screen) and rustfmt cleanups
- config.rs: auto-detect TTY presence for TUI enablement; use is_terminal()
  instead of relying solely on CI env var
This commit is contained in:
2026-04-26 22:50:46 +01:00
parent 70a84cefee
commit 45e2016918
7 changed files with 171 additions and 12 deletions
+10 -2
View File
@@ -1,4 +1,10 @@
use std::{collections::HashMap, env, fs, str::FromStr, sync::OnceLock};
use std::{
collections::HashMap,
env, fs,
io::{IsTerminal, stdin},
str::FromStr,
sync::OnceLock,
};
use serde::{Deserialize, Serialize};
@@ -86,7 +92,9 @@ pub fn init_config() {
};
if config.cook_opt.tui.is_none() {
config.cook_opt.tui = Some(!env::var("CI").is_ok_and(|s| !s.is_empty()));
let ci_set = env::var("CI").is_ok_and(|s| !s.is_empty());
let tty = stdin().is_terminal();
config.cook_opt.tui = Some(!ci_set && tty);
}
if config.cook_opt.jobs.is_none() {
config.cook_opt.jobs = Some(extract_env(