From f0607f7d4350bfa862479edb65c8fab6b3ff2e44 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Thu, 28 Nov 2024 10:10:35 +0300 Subject: [PATCH] Debrand for AlmaLinux --- almalinux_debrand.patch | 47 +++++++++++++++++++++++++++++++++++++++ subscription-manager.spec | 18 ++++++++++----- 2 files changed, 59 insertions(+), 6 deletions(-) create mode 100644 almalinux_debrand.patch diff --git a/almalinux_debrand.patch b/almalinux_debrand.patch new file mode 100644 index 0000000..21e0ac7 --- /dev/null +++ b/almalinux_debrand.patch @@ -0,0 +1,47 @@ +diff -aruN subscription-manager-1.29.37/etc-conf/syspurpose/valid_fields.json subscription-manager-1.29.37.alma/etc-conf/syspurpose/valid_fields.json +--- subscription-manager-1.29.37/etc-conf/syspurpose/valid_fields.json 2023-08-23 07:18:22 ++++ subscription-manager-1.29.37.alma/etc-conf/syspurpose/valid_fields.json 2023-10-09 23:38:40 +@@ -1,12 +1,10 @@ + { + "role": [ +- "Red Hat Enterprise Linux Server", +- "Red Hat Enterprise Linux Workstation", +- "Red Hat Enterprise Linux Compute Node" ++ "AlmaLinux Server", ++ "AlmaLinux Workstation", ++ "AlmaLinux Compute Node" + ], + "service_level_agreement": [ +- "Premium", +- "Standard", + "Self-Support" + ], + "usage": [ +diff -aruN subscription-manager-1.29.37/src/subscription_manager/repofile.py subscription-manager-1.29.37.alma/src/subscription_manager/repofile.py +--- subscription-manager-1.29.37/src/subscription_manager/repofile.py 2023-08-23 07:18:22 ++++ subscription-manager-1.29.37.alma/src/subscription_manager/repofile.py 2023-10-09 23:38:48 +@@ -375,11 +375,7 @@ + """ + Try to create new repo file. + """ +- self.create_dir_path() +- if self.path_exists(self.path) or not self.manage_repos: +- return +- with open(self.path, "w") as f: +- f.write(self.REPOFILE_HEADER) ++ pass + + def fix_content(self, content: str) -> str: + return content +diff -aruN subscription-manager-1.29.37/src/subscription_manager/repolib.py subscription-manager-1.29.37.alma/src/subscription_manager/repolib.py +--- subscription-manager-1.29.37/src/subscription_manager/repolib.py 2023-08-23 07:18:22 ++++ subscription-manager-1.29.37.alma/src/subscription_manager/repolib.py 2023-10-09 23:38:57 +@@ -92,7 +92,7 @@ + def warning_message(enabled_yum_plugins: List[str]) -> str: + message = _( + "The yum/dnf plugins: %s were automatically enabled for the benefit of " +- "Red Hat Subscription Management. If not desired, use " ++ "Subscription Management. If not desired, use " + '"subscription-manager config --rhsm.auto_enable_yum_plugins=0" to ' + "block this behavior." + ) % ", ".join(enabled_yum_plugins) diff --git a/subscription-manager.spec b/subscription-manager.spec index a1fbd46..708d800 100644 --- a/subscription-manager.spec +++ b/subscription-manager.spec @@ -96,7 +96,7 @@ Name: subscription-manager Version: 1.30.1 -Release: 1%{?dist} +Release: 1%{?dist}.alma.1 Summary: Tools and libraries for subscription and repository management %if 0%{?suse_version} Group: Productivity/Networking/System @@ -118,6 +118,9 @@ Source0: %{name}-%{version}.tar.gz Source2: subscription-manager-rpmlintrc %endif +# AlmaLinux patches +Patch1000: almalinux_debrand.patch + # The following macro examples are preceeded by '%' to stop macro expansion # in the comments. (See https://bugzilla.redhat.com/show_bug.cgi?id=1224660 for # why this is necessary) @@ -226,7 +229,7 @@ Obsoletes: %{py_package_prefix}-syspurpose <= %{version} %description The Subscription Manager package provides programs and libraries to allow users -to manage subscriptions and yum repositories from the Red Hat entitlement +to manage subscriptions and yum repositories from an entitlement platform. @@ -254,7 +257,7 @@ BuildRequires: libdnf-devel >= 0.22.5 Obsoletes: dnf-plugin-subscription-manager < 1.29.0 %description -n libdnf-plugin-subscription-manager -This package provides a plugin to interact with repositories from the Red Hat +This package provides a plugin to interact with repositories from an entitlement platform; contains only one product-id binary plugin used by e.g. microdnf. @@ -279,7 +282,7 @@ Requires: python3-librepo Requires: dnf >= 1.0.0 %description -n dnf-plugin-subscription-manager This package provides plugins to interact with repositories and subscriptions -from the Red Hat entitlement platform; contains subscription-manager and +from an entitlement platform; contains subscription-manager and product-id plugins. %endif @@ -315,7 +318,7 @@ the remote in the currently deployed .origin file. %package -n %{rhsm_package_name} -Summary: A Python library to communicate with a Red Hat Unified Entitlement Platform +Summary: A Python library to communicate with a Unified Entitlement Platform %if 0%{?suse_version} Group: Development/Libraries/Python %endif @@ -338,7 +341,7 @@ Provides: python-rhsm = %{version}-%{release} Obsoletes: python-rhsm <= 1.20.3-1 %description -n %{rhsm_package_name} -A small library for communicating with the REST interface of a Red Hat Unified +A small library for communicating with the REST interface of a Unified Entitlement Platform. This interface is used for the management of system entitlements, certificates, and access to content. @@ -736,6 +739,9 @@ rmdir %{python_sitearch}/subscription_manager-*-*.egg-info --ignore-fail-on-non- rm -f /var/lib/rhsm/cache/rhsm_icon.json %changelog +* Mon Oct 07 2024 Eduard Abdullin - 1.30.1-1.alma.1 +- Debrand for AlmaLinuxgi + * Wed Aug 21 2024 Pino Toscano 1.30.1-1 - feat: forcefully switch automatic cloud registration to v1 (ptoscano@redhat.com)