sync: 同步master修改

Signed-off-by: weidongkl <weidongkx@gmail.com>
(cherry picked from commit 188f37c4ee1926247951aaf59765426d3a058850)
This commit is contained in:
weidongkl 2024-09-19 15:34:48 +08:00 committed by openeuler-sync-bot
parent 5448fb7f6e
commit 2a034ff462
2 changed files with 13 additions and 2 deletions

View File

@ -4,11 +4,11 @@
Name: uname-build-checks
License: GPL v2 or later
License: GPL-2.0-or-later
Group: Development/Tools/Building
Summary: post checks for build after rpms have been created
Version: 1.0
Release: 0.5
Release: 0.7
BuildRequires: kernel, rpm, coreutils
Source0: uname.sh
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -55,6 +55,12 @@ fi
/.oe_kernelversion
%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
- rename uname-build-check.spec to uname-build-checks.spec

View File

@ -4,6 +4,11 @@ OUTPUT=`uname.bin $*`
NOT_INSTALLED="is not installed"
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`
if [ -z "$(echo "$dir" | grep "$NOT_INSTALLED")" ]; then
[ -n "$dir" ] && echo $dir && exit 0