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