Skip to content

Commit

Permalink
Invert dnf5 obsolete logic and make macro more explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
inknos authored and jan-kolarik committed Aug 16, 2023
1 parent 48c3dd5 commit 45332fd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dnf.spec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
%global conflicts_dnf_plugins_extras_version 4.0.4
%global conflicts_dnfdaemon_version 0.3.19

%bcond obsolete_dnf %[0%{?fedora} > 40 || 0%{?rhel} > 10]
%bcond dnf5_obsoletes_dnf %[0%{?fedora} > 40 || 0%{?rhel} > 10]

# override dependencies for rhel 7
%if 0%{?rhel} == 7
Expand Down Expand Up @@ -97,7 +97,7 @@ Conflicts: python3-dnf-plugins-extras-common < %{conflicts_dnf_plugins_extr
%package data
Summary: Common data and configuration files for DNF
Requires: libreport-filesystem
%if %{without obsolete_dnf}
%if %{with dnf5_obsoletes_dnf}
Requires: /etc/dnf/dnf.conf
%endif
Obsoletes: %{name}-conf <= %{version}-%{release}
Expand Down Expand Up @@ -237,7 +237,7 @@ ln -sr %{buildroot}%{confdir}/protected.d %{buildroot}%{_sysconfdir}/yum/protec
ln -sr %{buildroot}%{confdir}/vars %{buildroot}%{_sysconfdir}/yum/vars
%endif

%if %{without obsolete_dnf}
%if %{with dnf5_obsolete_dnf}
rm %{buildroot}%{confdir}/%{name}.conf
%endif

Expand Down Expand Up @@ -292,13 +292,13 @@ popd
%dir %{confdir}/modules.d
%dir %{confdir}/modules.defaults.d
%dir %{pluginconfpath}
%if %{with obsolete_dnf}
%if %{without dnf5_obsoletes_dnf}
%dir %{confdir}/protected.d
%dir %{confdir}/vars
%endif
%dir %{confdir}/aliases.d
%exclude %{confdir}/aliases.d/zypper.conf
%if %{with obsolete_dnf}
%if %{without dnf5_obsoletes_dnf}
%config(noreplace) %{confdir}/%{name}.conf
%endif

Expand Down

0 comments on commit 45332fd

Please sign in to comment.