From 3cf110da3f237c0d3bed802c9634416d2b6778b5 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Tue, 24 Sep 2024 16:25:10 +0300 Subject: [PATCH] - Debrand for AlmaLinux --- almalinux_debrand.patch | 47 +++++++++++++++++++++++++++++++++++++++ subscription-manager.spec | 10 ++++++++- 2 files changed, 56 insertions(+), 1 deletion(-) 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..0b13b02 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) @@ -362,6 +365,8 @@ cloud metadata and signatures. %prep %setup -q +%autopatch -p1 + %build make -f Makefile VERSION=%{version}-%{release} CFLAGS="%{optflags}" \ LDFLAGS="%{__global_ldflags}" OS_DIST="%{dist}" PYTHON="%{__python}" \ @@ -736,6 +741,9 @@ rmdir %{python_sitearch}/subscription_manager-*-*.egg-info --ignore-fail-on-non- rm -f /var/lib/rhsm/cache/rhsm_icon.json %changelog +* Tue Sep 24 2024 Eduard Abdullin - 1.30.1-1.alma.1 +- Debrand for AlmaLinux + * Wed Aug 21 2024 Pino Toscano 1.30.1-1 - feat: forcefully switch automatic cloud registration to v1 (ptoscano@redhat.com)