Added openMandriva support
This commit is contained in:
@@ -26,6 +26,7 @@ pub enum Distribution {
|
|||||||
Fedora,
|
Fedora,
|
||||||
Debian,
|
Debian,
|
||||||
Gentoo,
|
Gentoo,
|
||||||
|
OpenMandriva,
|
||||||
Suse,
|
Suse,
|
||||||
Void,
|
Void,
|
||||||
Solus,
|
Solus,
|
||||||
@@ -53,6 +54,7 @@ impl Distribution {
|
|||||||
Some("exherbo") => Distribution::Exherbo,
|
Some("exherbo") => Distribution::Exherbo,
|
||||||
Some("nixos") => Distribution::NixOS,
|
Some("nixos") => Distribution::NixOS,
|
||||||
Some("neon") => Distribution::KDENeon,
|
Some("neon") => Distribution::KDENeon,
|
||||||
|
Some("openmandriva") => Distribution::OpenMandriva,
|
||||||
_ => {
|
_ => {
|
||||||
if let Some(id_like) = id_like {
|
if let Some(id_like) = id_like {
|
||||||
if id_like.contains(&"debian") || id_like.contains(&"ubuntu") {
|
if id_like.contains(&"debian") || id_like.contains(&"ubuntu") {
|
||||||
@@ -105,6 +107,7 @@ impl Distribution {
|
|||||||
Distribution::NixOS => upgrade_nixos(ctx),
|
Distribution::NixOS => upgrade_nixos(ctx),
|
||||||
Distribution::KDENeon => upgrade_neon(ctx),
|
Distribution::KDENeon => upgrade_neon(ctx),
|
||||||
Distribution::Bedrock => update_bedrock(ctx),
|
Distribution::Bedrock => update_bedrock(ctx),
|
||||||
|
Distribution::OpenMandriva => upgrade_openmandriva(ctx),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,6 +221,28 @@ fn upgrade_suse(ctx: &ExecutionContext) -> Result<()> {
|
|||||||
Ok(())
|
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<()> {
|
fn upgrade_void(ctx: &ExecutionContext) -> Result<()> {
|
||||||
if let Some(sudo) = ctx.sudo() {
|
if let Some(sudo) = ctx.sudo() {
|
||||||
let mut command = ctx.run_type().execute(&sudo);
|
let mut command = ctx.run_type().execute(&sudo);
|
||||||
|
|||||||
Reference in New Issue
Block a user