committed by
GitHub
parent
e3d2d11e8a
commit
b77bbf57dd
@@ -227,14 +227,24 @@ fn upgrade_arch_linux(ctx: &ExecutionContext) -> Result<()> {
|
||||
}
|
||||
|
||||
fn upgrade_redhat(ctx: &ExecutionContext) -> Result<()> {
|
||||
if let Some(ostree) = Path::new("/usr/bin/rpm-ostree").if_exists() {
|
||||
let mut command = ctx.run_type().execute(ostree);
|
||||
command.arg("upgrade");
|
||||
if ctx.config().yes() {
|
||||
command.arg("-y");
|
||||
}
|
||||
|
||||
return command.check_run();
|
||||
}
|
||||
|
||||
if let Some(sudo) = &ctx.sudo() {
|
||||
let mut command = ctx.run_type().execute(&sudo);
|
||||
command
|
||||
.arg(Path::new("/usr/bin/dnf").if_exists().unwrap_or_else(|| {
|
||||
Path::new("/usr/bin/yum")
|
||||
.arg(
|
||||
Path::new("/usr/bin/dnf")
|
||||
.if_exists()
|
||||
.unwrap_or_else(|| Path::new("/usr/bin/rpm-ostree"))
|
||||
}))
|
||||
.unwrap_or_else(|| Path::new("/usr/bin/yum")),
|
||||
)
|
||||
.arg("upgrade");
|
||||
|
||||
if let Some(args) = ctx.config().dnf_arguments() {
|
||||
|
||||
Reference in New Issue
Block a user