Use DNF-3 in fedora

`/usr/bin/dnf` is a symlink to `/usr/bin/dnf-3` in the latest Fedora and CentOS 8. CentOS 7 doesn't have DNF at all.
This commit is contained in:
Marcelo dos Santos Mafra
2020-12-16 04:24:47 -03:00
committed by GitHub
parent fc83c5a4e4
commit e2cc0a8547

View File

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