Skip to content

Commit

Permalink
Unprotect dnf and yum, protect python3-dnf
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-goode authored and jan-kolarik committed May 18, 2023
1 parent 9e4f0eb commit 352b174
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
12 changes: 10 additions & 2 deletions dnf.spec
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,12 @@ popd
%dir %{confdir}/aliases.d
%exclude %{confdir}/aliases.d/zypper.conf
%config(noreplace) %{confdir}/%{name}.conf
%config(noreplace) %{confdir}/protected.d/%{name}.conf
# No longer using `noreplace` here. Older versions of DNF 4 marked `dnf` as a
# protected package, but since Fedora 39, DNF needs to be able to update itself
# to DNF 5, so we need to replace the old /etc/dnf/protected.d/dnf.conf.
%config %{confdir}/protected.d/%{name}.conf
# Protect python3-dnf instead, which does not conflict with DNF 5
%config(noreplace) %{confdir}/protected.d/python3-%{name}.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%ghost %attr(644,-,-) %{_localstatedir}/log/hawkey.log
%ghost %attr(644,-,-) %{_localstatedir}/log/%{name}.log
Expand All @@ -314,7 +319,10 @@ popd
%{_mandir}/man5/yum.conf.5.*
%{_mandir}/man8/yum-shell.8*
%{_mandir}/man1/yum-aliases.1*
%config(noreplace) %{confdir}/protected.d/yum.conf
# No longer using `noreplace` here. Older versions of DNF 4 marked `yum` as a
# protected package, but since Fedora 39, DNF needs to be able to update itself
# to DNF 5, so we need to replace the old /etc/dnf/protected.d/yum.conf.
%config %{confdir}/protected.d/yum.conf
%else
%exclude %{_sysconfdir}/yum.conf
%exclude %{_sysconfdir}/yum/pluginconf.d
Expand Down
2 changes: 1 addition & 1 deletion etc/dnf/protected.d/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
INSTALL (FILES "dnf.conf" "yum.conf" DESTINATION ${SYSCONFDIR}/dnf/protected.d)
INSTALL (FILES "dnf.conf" "yum.conf" "python3-dnf.conf" DESTINATION ${SYSCONFDIR}/dnf/protected.d)
4 changes: 3 additions & 1 deletion etc/dnf/protected.d/dnf.conf
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
dnf
# DNF is obsoleted in Fedora 39 by DNF 5 and should no longer be marked as protected.

# dnf
1 change: 1 addition & 0 deletions etc/dnf/protected.d/python3-dnf.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python3-dnf
5 changes: 4 additions & 1 deletion etc/dnf/protected.d/yum.conf
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
yum
# In Fedora 39, yum is obsoleted/provided by the dnf5 package rather than dnf,
# and DNF cannot replace itself with DNF5 if yum is marked as protected.

# yum

0 comments on commit 352b174

Please sign in to comment.