Skip to content

Commit

Permalink
bash-completion: Prepare ownerships for dnf5 switch
Browse files Browse the repository at this point in the history
Use `dnf-3` and `dnf4` files for bash completion and link the `dnf` only when `dnf5` is not used yet.
  • Loading branch information
jan-kolarik authored and ppisar committed Mar 28, 2024
1 parent 75803f5 commit 4334ea2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions dnf.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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-*

Expand Down Expand Up @@ -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*
Expand Down Expand Up @@ -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}/
Expand Down
2 changes: 1 addition & 1 deletion etc/bash_completion.d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
File renamed without changes.

0 comments on commit 4334ea2

Please sign in to comment.