Use distro-sync in dnf (fix #576) (#579)

This commit is contained in:
Roey Darwish Dror
2020-12-07 20:41:29 +02:00
committed by GitHub
parent 0ed5f8f96a
commit 76ae636f20

View File

@@ -243,13 +243,11 @@ fn upgrade_redhat(ctx: &ExecutionContext) -> Result<()> {
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("upgrade");
if let Some(dnf) = Path::new("/usr/bin/dnf").if_exists() {
command.arg(dnf).arg("distro-sync");
} else {
command.args(&["/usr/bin/yum", "upgrade"]);
}
if let Some(args) = ctx.config().dnf_arguments() {
command.args(args.split_whitespace());