diff --git a/src/steps/os/linux.rs b/src/steps/os/linux.rs index 19b17f68..96a35452 100644 --- a/src/steps/os/linux.rs +++ b/src/steps/os/linux.rs @@ -26,6 +26,7 @@ pub enum Distribution { Fedora, Debian, Gentoo, + OpenMandriva, Suse, Void, Solus, @@ -53,6 +54,7 @@ impl Distribution { Some("exherbo") => Distribution::Exherbo, Some("nixos") => Distribution::NixOS, Some("neon") => Distribution::KDENeon, + Some("openmandriva") => Distribution::OpenMandriva, _ => { if let Some(id_like) = id_like { if id_like.contains(&"debian") || id_like.contains(&"ubuntu") { @@ -105,6 +107,7 @@ impl Distribution { Distribution::NixOS => upgrade_nixos(ctx), Distribution::KDENeon => upgrade_neon(ctx), Distribution::Bedrock => update_bedrock(ctx), + Distribution::OpenMandriva => upgrade_openmandriva(ctx), } } @@ -218,6 +221,28 @@ fn upgrade_suse(ctx: &ExecutionContext) -> Result<()> { Ok(()) } +fn upgrade_openmandriva(ctx: &ExecutionContext) -> Result<()> { + if let Some(sudo) = &ctx.sudo() { + let mut command = ctx.run_type().execute(&sudo); + + command.arg(which("dnf").unwrap().to_path_buf()).arg("upgrade"); + + if let Some(args) = ctx.config().dnf_arguments() { + command.args(args.split_whitespace()); + } + + if ctx.config().yes(Step::System) { + command.arg("-y"); + } + + command.check_run()?; + } else { + print_warning("No sudo detected. Skipping system upgrade"); + } + + Ok(()) +} + fn upgrade_void(ctx: &ExecutionContext) -> Result<()> { if let Some(sudo) = ctx.sudo() { let mut command = ctx.run_type().execute(&sudo);