Fedora 44: replace dnf4 %post with dnf5 repo override
The %post scriptlet ran "dnf config-manager --save --setopt=...", which is dnf4-only syntax. On Fedora 44 (dnf5) it fails with "Unknown argument --save" (exit 2), so every install of this package ends with the dnf transaction marked as an error even though the package is installed, and the fedora*/updates* excludepkgs were never applied. Drop the scriptlet and ship a declarative dnf5 distribution override at /usr/share/dnf5/repos.override.d/50-ims-fedora-extras.repo instead. It uses glob repo IDs ([fedora*], [updates*]) to set excludepkgs=freeipa* frr* strongswan* on the stock Fedora repos. Require dnf5 explicitly.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
# InfoMaOS: exclude packages that are rebuilt in ims-fedora-extras from the
|
||||
# stock Fedora repositories. Loaded by dnf5 as a distribution repo override
|
||||
# (see "DROP-IN REPO DIRECTORIES" in dnf5.conf(5)).
|
||||
|
||||
[fedora*]
|
||||
excludepkgs=freeipa* frr* strongswan*
|
||||
|
||||
[updates*]
|
||||
excludepkgs=freeipa* frr* strongswan*
|
||||
@@ -1,6 +1,6 @@
|
||||
Summary: InfoMaOS Fedora extras release
|
||||
Name: ims-fedora-extras-release
|
||||
Version: 43
|
||||
Version: 44
|
||||
Release: 1%{?dist}
|
||||
License: GPLv2+
|
||||
Group: System Environment/Base
|
||||
@@ -9,8 +9,9 @@ BuildArch: noarch
|
||||
Source0: ims-fedora-extras.repo
|
||||
Source1: ims-fedora.repo
|
||||
Source2: ims-fedora-updates.repo
|
||||
Source3: 50-ims-fedora-extras.repo
|
||||
|
||||
Requires: dnf
|
||||
Requires: dnf5
|
||||
|
||||
%description
|
||||
InfoMaOS Fedora extras repository
|
||||
@@ -19,24 +20,32 @@ InfoMaOS Fedora extras repository
|
||||
%install
|
||||
%{__rm} -rf %{buildroot}
|
||||
|
||||
install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d
|
||||
install -dm 755 %{buildroot}%{_sysconfdir}/yum.repos.d
|
||||
install -pm 644 %{SOURCE0} %{buildroot}%{_sysconfdir}/yum.repos.d
|
||||
install -pm 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/yum.repos.d
|
||||
install -pm 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/yum.repos.d
|
||||
|
||||
install -pm 644 %{SOURCE0} $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d
|
||||
install -pm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d
|
||||
install -pm 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d
|
||||
# dnf5 distribution repo override: exclude our rebuilt packages from the
|
||||
# stock fedora*/updates* repos. Replaces the former dnf4 config-manager %%post.
|
||||
install -dm 755 %{buildroot}%{_datadir}/dnf5/repos.override.d
|
||||
install -pm 644 %{SOURCE3} %{buildroot}%{_datadir}/dnf5/repos.override.d
|
||||
|
||||
%clean
|
||||
%{__rm} -rf %{buildroot}
|
||||
|
||||
%post
|
||||
|
||||
dnf config-manager --save --setopt='*.excludepkgs="freeipa* frr* strongswan*"' fedora*
|
||||
dnf config-manager --save --setopt='*.excludepkgs="freeipa* frr* strongswan*"' updates*
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%{_sysconfdir}/yum.repos.d/*
|
||||
%{_datadir}/dnf5/repos.override.d/50-ims-fedora-extras.repo
|
||||
|
||||
%changelog
|
||||
* Thu Sep 10 2026 Zoran Pericic <zoran.pericic@netst.org> - 44-1
|
||||
- Drop %%post scriptlet: "dnf config-manager --save" is dnf4-only and fails
|
||||
with exit status 2 on dnf5, making the install transaction report an error
|
||||
- Ship /usr/share/dnf5/repos.override.d/50-ims-fedora-extras.repo instead,
|
||||
a declarative dnf5 override excluding freeipa*/frr*/strongswan* from
|
||||
fedora* and updates* repos
|
||||
- Require dnf5
|
||||
|
||||
* Wed Mar 23 2022 Zoran Pericic <zoran.pericic@netst.org>
|
||||
Initial release
|
||||
|
||||
Reference in New Issue
Block a user