!17 [sync] PR-12: sync: 同步master最新修改

From: @openeuler-sync-bot 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
This commit is contained in:
openeuler-ci-bot 2024-09-23 09:14:05 +00:00 committed by Gitee
commit ef9bbdd72b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 13 additions and 2 deletions

View File

@ -4,11 +4,11 @@
Name: uname-build-checks Name: uname-build-checks
License: GPL v2 or later License: GPL-2.0-or-later
Group: Development/Tools/Building Group: Development/Tools/Building
Summary: post checks for build after rpms have been created Summary: post checks for build after rpms have been created
Version: 1.0 Version: 1.0
Release: 0.5 Release: 0.7
BuildRequires: kernel, rpm, coreutils BuildRequires: kernel, rpm, coreutils
Source0: uname.sh Source0: uname.sh
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -55,6 +55,12 @@ fi
/.oe_kernelversion /.oe_kernelversion
%changelog %changelog
* Thu Sep 19 2024 weidongkl <weidongkx@gmail.com> 1.0-0.7
- fix: https://gitee.com/src-openeuler/uname-build-checks/issues/IAS6IX
* Wed Jun 12 2024 yinyongkang <yinyongkang@kylinos.cn> 1.0-0.6
- license info rectification
* Tue Jan 5 2021 shenyangyang4@huawei.com 1.0-0.5 * Tue Jan 5 2021 shenyangyang4@huawei.com 1.0-0.5
- rename uname-build-check.spec to uname-build-checks.spec - rename uname-build-check.spec to uname-build-checks.spec

View File

@ -4,6 +4,11 @@ OUTPUT=`uname.bin $*`
NOT_INSTALLED="is not installed" NOT_INSTALLED="is not installed"
if [[ $* == "-r" ]];then if [[ $* == "-r" ]];then
lines=`rpm -q --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n' kernel | wc -l`
if [ "$lines" -gt 1 ]; then
echo $OUTPUT
exit 0
fi
dir=`rpm -q --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n' kernel | head -n 1` dir=`rpm -q --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n' kernel | head -n 1`
if [ -z "$(echo "$dir" | grep "$NOT_INSTALLED")" ]; then if [ -z "$(echo "$dir" | grep "$NOT_INSTALLED")" ]; then
[ -n "$dir" ] && echo $dir && exit 0 [ -n "$dir" ] && echo $dir && exit 0