Adapt product feature to local release version
This commit is contained in:
parent
fac7188746
commit
6ffc7ee33e
@ -0,0 +1,93 @@
|
|||||||
|
From dcd5f6b38e895134bb24df4c8fa4a0fba3e0f381 Mon Sep 17 00:00:00 2001
|
||||||
|
From: yixiangzhike <yixiangzhike007@163.com>
|
||||||
|
Date: Mon, 29 May 2023 11:22:03 +0800
|
||||||
|
Subject: [PATCH] Adapt product feature to local release version
|
||||||
|
|
||||||
|
---
|
||||||
|
src/journal.sh | 6 +++++-
|
||||||
|
src/logging.sh | 10 +++++++++-
|
||||||
|
src/lsb_release | 4 ++++
|
||||||
|
src/test/loggingTest.sh | 6 +++++-
|
||||||
|
4 files changed, 23 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/journal.sh b/src/journal.sh
|
||||||
|
index 62ce983..8ae06e6 100644
|
||||||
|
--- a/src/journal.sh
|
||||||
|
+++ b/src/journal.sh
|
||||||
|
@@ -874,7 +874,11 @@ __INTERNAL_CreateHeader(){
|
||||||
|
__INTERNAL_LogText " Test duration : " 2> /dev/null
|
||||||
|
|
||||||
|
# OS release
|
||||||
|
- local release=$(cat /etc/redhat-release)
|
||||||
|
+ if [ -e /etc/openEuler-release ]; then
|
||||||
|
+ local release=$(cat /etc/openEuler-release)
|
||||||
|
+ else
|
||||||
|
+ local release=$(cat /etc/redhat-release)
|
||||||
|
+ fi
|
||||||
|
[[ -n "$release" ]] && {
|
||||||
|
__INTERNAL_WriteToMetafile release -- "$release"
|
||||||
|
__INTERNAL_LogText " Distro : ${release}" 2> /dev/null
|
||||||
|
diff --git a/src/logging.sh b/src/logging.sh
|
||||||
|
index 738bef0..96455c7 100644
|
||||||
|
--- a/src/logging.sh
|
||||||
|
+++ b/src/logging.sh
|
||||||
|
@@ -881,7 +881,9 @@ on the RHEL-5-Client you will get release 5 and variant Client.
|
||||||
|
|
||||||
|
__INTERNAL_rlGetDistroVersion() {
|
||||||
|
local version=0
|
||||||
|
- if rpm -q redhat-release &>/dev/null; then
|
||||||
|
+ if rpm -q openEuler-release &>/dev/null; then
|
||||||
|
+ version=$( rpm -q --qf="%{VERSION}" openEuler-release )
|
||||||
|
+ elif rpm -q redhat-release &>/dev/null; then
|
||||||
|
version=$( rpm -q --qf="%{VERSION}" redhat-release )
|
||||||
|
elif rpm -q fedora-release &>/dev/null; then
|
||||||
|
version=$( rpm -q --qf="%{VERSION}" fedora-release )
|
||||||
|
@@ -905,6 +907,12 @@ rlGetDistroRelease() {
|
||||||
|
}
|
||||||
|
rlGetDistroVariant() {
|
||||||
|
local VARIANT
|
||||||
|
+ # openEuler has no Variant
|
||||||
|
+ if rpm -q openEuler-release &>/dev/null; then
|
||||||
|
+ echo $VARIANT
|
||||||
|
+ return 0
|
||||||
|
+ fi
|
||||||
|
+
|
||||||
|
VARIANT=$(__INTERNAL_rlGetOSReleaseItem VARIANT) && {
|
||||||
|
echo $VARIANT
|
||||||
|
return 0
|
||||||
|
diff --git a/src/lsb_release b/src/lsb_release
|
||||||
|
index 9d7afbc..8b04c75 100755
|
||||||
|
--- a/src/lsb_release
|
||||||
|
+++ b/src/lsb_release
|
||||||
|
@@ -72,7 +72,11 @@ INFO_LSB_DIR="lsb-release.d" # where to get LSB addon modules
|
||||||
|
INFO_DISTRIB_SUFFIX="release" # <distrib>-<suffix>
|
||||||
|
ALTERNATE_DISTRIB_FILE="/etc/debian_version" # for Debian [based distrib]
|
||||||
|
ALTERNATE_DISTRIB_NAME="Debian" # "
|
||||||
|
+if [ -e /etc/openEuler-release ]; then
|
||||||
|
+CHECKFIRST="/etc/openEuler-release" # check it before file search
|
||||||
|
+else
|
||||||
|
CHECKFIRST="/etc/redhat-release" # check it before file search
|
||||||
|
+fi
|
||||||
|
|
||||||
|
# Defines our exit codes
|
||||||
|
EXIT_STATUS="0" # default = Ok :)
|
||||||
|
diff --git a/src/test/loggingTest.sh b/src/test/loggingTest.sh
|
||||||
|
index a4bc588..a9de8f8 100644
|
||||||
|
--- a/src/test/loggingTest.sh
|
||||||
|
+++ b/src/test/loggingTest.sh
|
||||||
|
@@ -237,7 +237,11 @@ test_rlGetArch() {
|
||||||
|
test_rlGetDistroRelease() {
|
||||||
|
local out=$(rlGetDistroRelease)
|
||||||
|
assertTrue 'rlGetDistroRelease returns 0' "[ $? -eq 0 ]"
|
||||||
|
- if [ -e /etc/redhat-release ]
|
||||||
|
+ if [ -e /etc/openEuler-release ]
|
||||||
|
+ then
|
||||||
|
+ grep -q -i "$out" /etc/openEuler-release
|
||||||
|
+ assertTrue 'rlGetDistroRelease returns release which is in the /etc/openEuler-release' "[ $? -eq 0 ]"
|
||||||
|
+ elif [ -e /etc/redhat-release ]
|
||||||
|
then
|
||||||
|
grep -q -i "$out" /etc/redhat-release
|
||||||
|
assertTrue 'rlGetDistroRelease returns release which is in the /etc/redhat-release' "[ $? -eq 0 ]"
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
Name: beakerlib
|
Name: beakerlib
|
||||||
Summary: A shell-level integration testing library
|
Summary: A shell-level integration testing library
|
||||||
Version: 1.29.1
|
Version: 1.29.1
|
||||||
Release: 1
|
Release: 2
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
URL: https://github.com/%{name}/%{name}
|
URL: https://github.com/%{name}/%{name}
|
||||||
@ -24,6 +24,8 @@ BuildRequires: /usr/bin/pod2man perl-generators util-linux
|
|||||||
|
|
||||||
Source0: https://github.com/beakerlib/beakerlib/archive/%{version}.tar.gz
|
Source0: https://github.com/beakerlib/beakerlib/archive/%{version}.tar.gz
|
||||||
|
|
||||||
|
Patch1: beakerlib-adapt-product-feature-to-local-release-version.patch
|
||||||
|
|
||||||
%package_help
|
%package_help
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
@ -77,6 +79,9 @@ Files for syntax highlighting BeakerLib tests in VIM editor
|
|||||||
%doc %{_pkgdocdir}/*
|
%doc %{_pkgdocdir}/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon May 29 2023 yixiangzhike <yixiangzhike007@163.com> - 1.29.1-2
|
||||||
|
- adapt product feature to local release version
|
||||||
|
|
||||||
* Fri Jul 22 2022 lilong <lilong@kylinos.cn> - 1.29.1-1
|
* Fri Jul 22 2022 lilong <lilong@kylinos.cn> - 1.29.1-1
|
||||||
- Update to 1.29.1
|
- Update to 1.29.1
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user