From 77d2999c7f15f5d074b52eff5636855a353db006 Mon Sep 17 00:00:00 2001 From: Jan Kolarik Date: Wed, 27 Mar 2024 13:28:32 +0000 Subject: [PATCH] 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. --- dnf.spec | 8 ++++++-- etc/bash_completion.d/CMakeLists.txt | 2 +- etc/bash_completion.d/{dnf => dnf-3} | 0 3 files changed, 7 insertions(+), 3 deletions(-) rename etc/bash_completion.d/{dnf => dnf-3} (100%) diff --git a/dnf.spec b/dnf.spec index 33bfb28ac1..dea2a63b0d 100644 --- a/dnf.spec +++ b/dnf.spec @@ -223,6 +223,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-* @@ -279,8 +281,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* @@ -368,6 +368,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}/ diff --git a/etc/bash_completion.d/CMakeLists.txt b/etc/bash_completion.d/CMakeLists.txt index be813103de..a941f18512 100644 --- a/etc/bash_completion.d/CMakeLists.txt +++ b/etc/bash_completion.d/CMakeLists.txt @@ -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}) diff --git a/etc/bash_completion.d/dnf b/etc/bash_completion.d/dnf-3 similarity index 100% rename from etc/bash_completion.d/dnf rename to etc/bash_completion.d/dnf-3