diff --git a/lib/Cargo.toml b/lib/Cargo.toml index dfee6a00..3e6493b4 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -11,6 +11,8 @@ rust-version = "1.64.0" include = ["/src", "LICENSE-APACHE", "LICENSE-MIT"] [dependencies] +anstream = "0.6.4" +anstyle = "1.0.4" anyhow = "1.0" camino = { version = "1.0.4", features = ["serde1"] } ostree-ext = "0.12" diff --git a/lib/src/install.rs b/lib/src/install.rs index 3cc5c21b..4bdc5d00 100644 --- a/lib/src/install.rs +++ b/lib/src/install.rs @@ -790,6 +790,10 @@ async fn prepare_install( crate::cli::require_root()?; require_systemd_pid1()?; + if cfg!(target_arch = "s390x") { + anyhow::bail!("Installation is not supported on this architecture yet"); + } + let rootfs = cap_std::fs::Dir::open_ambient_dir("/", cap_std::ambient_authority()) .context("Opening /")?; diff --git a/lib/src/status.rs b/lib/src/status.rs index 29079bf7..0296daab 100644 --- a/lib/src/status.rs +++ b/lib/src/status.rs @@ -262,7 +262,7 @@ pub(crate) async fn status(opts: super::cli::StatusOpts) -> Result<()> { host }; - eprintln!("note: The format of this API is not yet stable"); + crate::utils::warning("note: The format of this API is not yet stable"); // If we're in JSON mode, then convert the ostree data into Rust-native // structures that can be serialized. diff --git a/lib/src/utils.rs b/lib/src/utils.rs index 51a73c41..3c73e8f6 100644 --- a/lib/src/utils.rs +++ b/lib/src/utils.rs @@ -60,6 +60,15 @@ pub(crate) fn spawn_editor(tmpf: &tempfile::NamedTempFile) -> Result<()> { Ok(()) } +/// Output a warning message +pub(crate) fn warning(s: &str) { + anstream::eprintln!( + "{}{s}{}", + anstyle::AnsiColor::Red.render_fg(), + anstyle::Reset.render() + ); +} + /// Given a possibly tagged image like quay.io/foo/bar:latest and a digest 0ab32..., return /// the digested form quay.io/foo/bar:latest@sha256:0ab32... /// If the image already has a digest, it will be replaced.