From 592c6f5ef37ce73729569802512c1c849be20d6c Mon Sep 17 00:00:00 2001 From: yangxianzhao Date: Thu, 9 May 2024 11:27:52 +0800 Subject: [PATCH] fix os-release path --- 0001-fix-os-release-path.patch | 32 ++++++++++++++++++++++++++++++++ ancert.spec | 7 ++++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 0001-fix-os-release-path.patch diff --git a/0001-fix-os-release-path.patch b/0001-fix-os-release-path.patch new file mode 100644 index 0000000..c5ca79b --- /dev/null +++ b/0001-fix-os-release-path.patch @@ -0,0 +1,32 @@ +From dc2bb8c75abcce3b64ff9293dcbe148677731ca9 Mon Sep 17 00:00:00 2001 +From: yangxianzhao +Date: Thu, 9 May 2024 11:21:56 +0800 +Subject: [PATCH] fix os-release path + +--- + lib/utils.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/utils.py b/lib/utils.py +index eb20249..9a560c9 100644 +--- a/lib/utils.py ++++ b/lib/utils.py +@@ -380,7 +380,7 @@ def get_kernel_version(): + + + def get_os_version(): +- cmd = 'cat /etc/redhat-release' ++ cmd = 'cat /etc/os-release' + rc, output = run_local_cmd(cmd, exit_msg='Failed to get OS version!', shell=True) + print('OS Relase: %s' % output.strip()) + +@@ -890,4 +890,4 @@ def generate_summary_report(args, tasks, logdir): + print('%s TEST SKIP!' % t.test.case.name) + else: + print('%s TEST FAIL!' % t.test.case.name) +- print('') +\ No newline at end of file ++ print('') +-- +2.39.3 + diff --git a/ancert.spec b/ancert.spec index a862e57..a5e1fbb 100755 --- a/ancert.spec +++ b/ancert.spec @@ -1,4 +1,4 @@ -%define anolis_release 1 +%define anolis_release 2 %define __lib lib %undefine __brp_mangle_shebangs @@ -11,6 +11,7 @@ Group: Development/Libraries Vendor: Alibaba URL: https://gitee.com/anolis/ancert Source: %{name}-v%{version}.tar.gz +Patch1: 0001-fix-os-release-path.patch BuildRequires: make, gcc, gcc-c++ Requires: make, gcc, gcc-c++ Requires: fio, nvme-cli, glx-utils, python3, rpm-build, bc, lvm2 @@ -35,6 +36,7 @@ The %{name}-doc package contains documentation files for %{name}. %prep %setup -qn %{name}-v%{version} +%patch1 -p1 %install make DESTDIR=%{buildroot}%{_datadir}/%{name} post_install @@ -71,6 +73,9 @@ fi %doc README.md %changelog +* Thu May 09 2024 yangxianzhao -2.0-2 +- fix os-release path + * Mon Nov 21 2022 chaofengwu <17269747_wcf@163.com> -2.0-1 - update ancert architecture to 2.0 -- Gitee