From 03b6fd490be2571efa60a2c30508aeadf707cdc3 Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: May 20 2021 01:17:02 +0000 Subject: Limit enabling powertools to the hotfixes package; use %posttrans not %post Using %posttrans rather than %post ensures that the repo does not get enabled mid-transaction Also, limit this to hotfixes as it is the one that pulls in EPEL and so might need PowerTools ``` [vagrant@localhost ~]$ dnf repolist enabled repo id repo name appstream CentOS Stream 8 - AppStream baseos CentOS Stream 8 - BaseOS centos-hyperscale CentOS Stream 8 - Hyperscale epel Extra Packages for Enterprise Linux 8 - x86_64 epel-modular Extra Packages for Enterprise Linux Modular 8 - x86_64 extras CentOS Stream 8 - Extras [vagrant@localhost ~]$ sudo dnf install /vagrant/centos-release-hyperscale-4-3.el8.noarch.rpm Last metadata expiration check: 0:18:44 ago on Thu 20 May 2021 12:56:48 AM UTC. Dependencies resolved. ============================================================================================================================================================================================= Package Architecture Version Repository Size ============================================================================================================================================================================================= Upgrading: centos-release-hyperscale noarch 4-3.el8 @commandline 9.6 k Transaction Summary ============================================================================================================================================================================================= Upgrade 1 Package Total size: 9.6 k Is this ok [y/N]: y Downloading Packages: Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Upgrading : centos-release-hyperscale-4-3.el8.noarch 1/2 Cleanup : centos-release-hyperscale-4-1.el8.noarch 2/2 Verifying : centos-release-hyperscale-4-3.el8.noarch 1/2 Verifying : centos-release-hyperscale-4-1.el8.noarch 2/2 Upgraded: centos-release-hyperscale-4-3.el8.noarch Complete! [vagrant@localhost ~]$ dnf repolist enabled repo id repo name appstream CentOS Stream 8 - AppStream baseos CentOS Stream 8 - BaseOS centos-hyperscale CentOS Stream 8 - Hyperscale epel Extra Packages for Enterprise Linux 8 - x86_64 epel-modular Extra Packages for Enterprise Linux Modular 8 - x86_64 extras CentOS Stream 8 - Extras [vagrant@localhost ~]$ sudo dnf install /vagrant/centos-release-hyperscale-hotfixes-4-3.el8.noarch.rpm Last metadata expiration check: 0:18:53 ago on Thu 20 May 2021 12:56:48 AM UTC. Dependencies resolved. ============================================================================================================================================================================================= Package Architecture Version Repository Size ============================================================================================================================================================================================= Installing: centos-release-hyperscale-hotfixes noarch 4-3.el8 @commandline 8.4 k Transaction Summary ============================================================================================================================================================================================= Install 1 Package Total size: 8.4 k Installed size: 386 Is this ok [y/N]: y Downloading Packages: Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : centos-release-hyperscale-hotfixes-4-3.el8.noarch 1/1 Running scriptlet: centos-release-hyperscale-hotfixes-4-3.el8.noarch 1/1 Verifying : centos-release-hyperscale-hotfixes-4-3.el8.noarch 1/1 Installed: centos-release-hyperscale-hotfixes-4-3.el8.noarch Complete! [vagrant@localhost ~]$ dnf repolist enabled repo id repo name appstream CentOS Stream 8 - AppStream baseos CentOS Stream 8 - BaseOS centos-hyperscale CentOS Stream 8 - Hyperscale centos-hyperscale-hotfixes CentOS Stream 8 - Hyperscale Hotfixes epel Extra Packages for Enterprise Linux 8 - x86_64 epel-modular Extra Packages for Enterprise Linux Modular 8 - x86_64 extras CentOS Stream 8 - Extras powertools CentOS Stream 8 - PowerTools ``` Signed-off-by: Michel Alexandre Salim --- diff --git a/SPECS/centos-release-hyperscale.spec b/SPECS/centos-release-hyperscale.spec index e47fb7f..cc39581 100644 --- a/SPECS/centos-release-hyperscale.spec +++ b/SPECS/centos-release-hyperscale.spec @@ -1,7 +1,7 @@ Summary: CentOS Hyperscale SIG main repo configs Name: centos-release-hyperscale Version: 4 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2 URL: http://wiki.centos.org/SpecialInterestGroup/Hyperscale Source0: RPM-GPG-KEY-CentOS-SIG-HyperScale @@ -47,7 +47,7 @@ install -d %{buildroot}%{_sysconfdir}/yum.repos.d install -p -m 644 %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} \ %{buildroot}%{_sysconfdir}/yum.repos.d -%post +%posttrans hotfixes POWERTOOLS_REPO=/etc/yum.repos.d/CentOS-Stream-PowerTools.repo if [ -f "${POWERTOOLS_REPO}" ] \ && [ $(grep -c '^enabled=.$' "${POWERTOOLS_REPO}") -eq 1 ] \ @@ -73,6 +73,11 @@ fi %config(noreplace) %{_sysconfdir}/yum.repos.d/CentOS-Stream-Hyperscale-Spin.repo %changelog +* Wed May 19 2021 Michel Alexandre Salim - 4-3 +- Switch to %%posttrans for enabling powertools; + this way, we don't enable a repo mid-transaction +- Limit it to the hotfixes subpackage as that requires EPEL + * Wed May 19 2021 Michel Alexandre Salim - 4-2 - Trigger enabling powertools repo on package installations and upgrades - Fix license declaration; match centos-stream-repos