From d70f4920cd0a5507e86c146e5c1bb0f8ccc37883 Mon Sep 17 00:00:00 2001 From: Chunmei Xu Date: Thu, 17 Mar 2022 17:09:59 +0800 Subject: [PATCH] remove the trailing newline for /etc/system_release Signed-off-by: Chunmei Xu --- ...e-the-trailing-newline-for-etc-syste.patch | 26 +++++++++++++++++++ policycoreutils.spec | 6 ++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 0002-remove-the-trailing-newline-for-etc-syste.patch diff --git a/0002-remove-the-trailing-newline-for-etc-syste.patch b/0002-remove-the-trailing-newline-for-etc-syste.patch new file mode 100644 index 0000000..7d20801 --- /dev/null +++ b/0002-remove-the-trailing-newline-for-etc-syste.patch @@ -0,0 +1,26 @@ +From 7572bbec8b6a422e722864348a53d5e0f855e7f6 Mon Sep 17 00:00:00 2001 +From: Miroslav Grepl +Date: Fri, 20 Feb 2015 16:42:01 +0100 +Subject: [PATCH] We want to remove the trailing newline for + /etc/system_release. + +--- + python/sepolicy/sepolicy/__init__.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/python/sepolicy/sepolicy/__init__.py b/python/sepolicy/sepolicy/__init__.py +index a2475d22547a..8055a12f6020 100644 +--- a/python/sepolicy/sepolicy/__init__.py ++++ b/python/sepolicy/sepolicy/__init__.py +@@ -1228,7 +1228,7 @@ def get_os_version(): + system_release = "" + try: + with open('/etc/system-release') as f: +- system_release = f.readline() ++ system_release = f.readline().rstrip() + except IOError: + system_release = "Misc" + +-- +2.32.0 + diff --git a/policycoreutils.spec b/policycoreutils.spec index 42744d1..08c0313 100644 --- a/policycoreutils.spec +++ b/policycoreutils.spec @@ -1,4 +1,4 @@ -%define anolis_release 2 +%define anolis_release 3 %global libauditver 3.0 %global libsepolver 3.3-1 %global libsemanagever 3.3-1 @@ -19,6 +19,7 @@ Source0: https://github.com/SELinuxProject/selinux/releases/download/3.3/selinux URL: https://github.com/SELinuxProject/selinux Patch0001: 0001-Simplication-of-sepolicy-manpage-web-functionality.patch +Patch0002: 0002-remove-the-trailing-newline-for-etc-syste.patch Obsoletes: policycoreutils < 2.0.61-2 Conflicts: filesystem < 3, selinux-policy-base < 3.13.1-138 @@ -409,6 +410,9 @@ The policycoreutils-restorecond package contains the restorecond service. %systemd_postun_with_restart restorecond.service %changelog +* Thu Mar 17 2022 Chunmei Xu - 3.3-3 +- remove the trailing newline for /etc/system_release + * Thu Mar 17 2022 Liwei Ge - 3.3-2 - Simplication of sepolicy-manpage web functionality -- Gitee