diff --git a/dnf.spec b/dnf.spec index bda25b6c52..9094d20086 100644 --- a/dnf.spec +++ b/dnf.spec @@ -84,6 +84,7 @@ BuildRequires: bash-completion-devel %else BuildRequires: bash-completion %endif +Requires: coreutils BuildRequires: %{_bindir}/sphinx-build-3 Requires: python3-%{name} = %{version}-%{release} %if 0%{?rhel} && 0%{?rhel} <= 7 diff --git a/etc/bash_completion.d/dnf b/etc/bash_completion.d/dnf index 8a9256a695..624bd3ed76 100644 --- a/etc/bash_completion.d/dnf +++ b/etc/bash_completion.d/dnf @@ -433,4 +433,11 @@ _dnf() return 0 } -complete -F _dnf dnf dnf-2 dnf-3 +complete_cmds="dnf-2 dnf-3 dnf4" +dnf_target=$(readlink -f "/usr/bin/dnf") + +if [ "$dnf_target" = "/usr/bin/dnf-3" ]; then + complete_cmds+=" dnf" +fi + +complete -F _dnf $complete_cmds