bash-completion: Prepare ownerships for dnf5 switch

Use `dnf-3` and `dnf4` files for bash completion and link the `dnf` only when `dnf5` is not used yet.
This commit is contained in:
Jan Kolarik 2024-03-27 13:28:32 +00:00 committed by Petr Pisar
parent 75803f54d1
commit 4334ea254a
3 changed files with 7 additions and 3 deletions

View File

@ -224,6 +224,8 @@ mkdir -p %{buildroot}%{_var}/cache/dnf/
touch %{buildroot}%{_localstatedir}/log/%{name}.log
ln -sr %{buildroot}%{_bindir}/dnf-3 %{buildroot}%{_bindir}/dnf
ln -sr %{buildroot}%{_bindir}/dnf-3 %{buildroot}%{_bindir}/dnf4
ln -sr %{buildroot}%{_datadir}/bash-completion/completions/dnf-3 %{buildroot}%{_datadir}/bash-completion/completions/dnf4
ln -sr %{buildroot}%{_datadir}/bash-completion/completions/dnf-3 %{buildroot}%{_datadir}/bash-completion/completions/dnf
mv %{buildroot}%{_bindir}/dnf-automatic-3 %{buildroot}%{_bindir}/dnf-automatic
rm -vf %{buildroot}%{_bindir}/dnf-automatic-*
@ -280,8 +282,6 @@ popd
%if 0%{?rhel} && 0%{?rhel} <= 7
%{_sysconfdir}/bash_completion.d/%{name}
%else
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/%{name}
%endif
%{_mandir}/man8/%{name}.8*
@ -369,6 +369,10 @@ popd
%files -n python3-%{name}
%{_bindir}/%{name}-3
%{_bindir}/%{name}4
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/%{name}-3
%{_datadir}/bash-completion/completions/%{name}4
%exclude %{python3_sitelib}/%{name}/automatic
%{python3_sitelib}/%{name}-*.dist-info
%{python3_sitelib}/%{name}/

View File

@ -6,4 +6,4 @@ if(NOT BASH_COMPLETION_COMPLETIONSDIR)
set(BASH_COMPLETION_COMPLETIONSDIR "${SYSCONFDIR}/bash_completion.d")
endif()
endif()
install(FILES "dnf" DESTINATION ${BASH_COMPLETION_COMPLETIONSDIR})
install(FILES "dnf-3" DESTINATION ${BASH_COMPLETION_COMPLETIONSDIR})