From a9700314fc3f15b7d064355b84743a257d69abe4 Mon Sep 17 00:00:00 2001 From: Joseph Marrero Date: Tue, 5 Dec 2023 09:53:35 -0500 Subject: [PATCH] cli: Add build-commit --- lib/src/cli.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/src/cli.rs b/lib/src/cli.rs index eaf724153..be2b11f93 100644 --- a/lib/src/cli.rs +++ b/lib/src/cli.rs @@ -150,6 +150,8 @@ pub(crate) enum Opt { /// Add a transient writable overlayfs on `/usr` that will be discarded on reboot. #[clap(alias = "usroverlay")] UsrOverlay, + /// Validate non supported files are not present. + BuildCommit, /// Install to the target block device #[cfg(feature = "install")] Install(crate::install::InstallOpts), @@ -436,6 +438,15 @@ async fn usroverlay() -> Result<()> { .into()); } +/// Implementation of `bootc build commit` +async fn commit() -> Result<()> { + // This is just a pass-through today. At some point we may diverge from ostree-ext. + return Err(Command::new("ostree") + .args(["container", "commit"]) + .exec() + .into()); +} + /// Parse the provided arguments and execute. /// Calls [`structopt::clap::Error::exit`] on failure, printing the error message and aborting the program. pub async fn run_from_iter(args: I) -> Result<()> @@ -453,6 +464,7 @@ async fn run_from_opt(opt: Opt) -> Result<()> { Opt::Switch(opts) => switch(opts).await, Opt::Edit(opts) => edit(opts).await, Opt::UsrOverlay => usroverlay().await, + Opt::BuildCommit => commit().await, #[cfg(feature = "install")] Opt::Install(opts) => crate::install::install(opts).await, #[cfg(feature = "install")]