Skip to content

Commit

Permalink
Revert "Unprotect dnf and yum, protect python3-dnf"
Browse files Browse the repository at this point in the history
This reverts commit 352b174.
adding the condition %{witout dnf5_obsoletes_dnf} to keep the
unprotected directive for chroots that build dnf with rpm
option with=dnf5_obsoletes_dnf
  • Loading branch information
inknos committed Aug 30, 2023
1 parent 33fde24 commit 108a1ef
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
15 changes: 8 additions & 7 deletions dnf.spec
Original file line number Diff line number Diff line change
Expand Up @@ -299,15 +299,10 @@ popd
%dir %{confdir}/aliases.d
%exclude %{confdir}/aliases.d/zypper.conf
%if %{without dnf5_obsoletes_dnf}
# If DNF5 does not obsolete DNF ownership of dnf.conf should be DNF's
%config(noreplace) %{confdir}/%{name}.conf
%endif

# 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) %{confdir}/protected.d/%{name}.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%ghost %attr(644,-,-) %{_localstatedir}/log/hawkey.log
%ghost %attr(644,-,-) %{_localstatedir}/log/%{name}.log
Expand All @@ -333,10 +328,16 @@ popd
%{_mandir}/man5/yum.conf.5.*
%{_mandir}/man8/yum-shell.8*
%{_mandir}/man1/yum-aliases.1*
%if %{without dnf5_obsoletes_dnf}
# If DNF5 does not obsolete DNF, protected.d/yum.conf should be owned by DNF
%config(noreplace) %{confdir}/protected.d/yum.conf
%else
# If DNF5 obsoletes DNF
# 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
%endif
%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" "python3-dnf.conf" DESTINATION ${SYSCONFDIR}/dnf/protected.d)
INSTALL (FILES "dnf.conf" "yum.conf" DESTINATION ${SYSCONFDIR}/dnf/protected.d)
4 changes: 1 addition & 3 deletions etc/dnf/protected.d/dnf.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# DNF is obsoleted in Fedora 39 by DNF 5 and should no longer be marked as protected.

# dnf
dnf
1 change: 0 additions & 1 deletion etc/dnf/protected.d/python3-dnf.conf

This file was deleted.

5 changes: 1 addition & 4 deletions etc/dnf/protected.d/yum.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# 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
yum

0 comments on commit 108a1ef

Please sign in to comment.