diff --git a/uname-build-checks.spec b/uname-build-checks.spec index 30ad5c8accc70bcb6c0a84c19e251ecd161756e1..80ff0e4bf6ec130695b6c0306d3f0ece22f85260 100644 --- a/uname-build-checks.spec +++ b/uname-build-checks.spec @@ -8,7 +8,7 @@ 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.6 +Release: 0.7 BuildRequires: kernel, rpm, coreutils Source0: uname.sh BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -55,6 +55,9 @@ fi /.oe_kernelversion %changelog +* Thu Sep 19 2024 weidongkl 1.0-0.7 +- fix: https://gitee.com/src-openeuler/uname-build-checks/issues/IAS6IX + * Wed Jun 12 2024 yinyongkang 1.0-0.6 - license info rectification diff --git a/uname.sh b/uname.sh index 9e7cafb1c7e75145254a7a93965d32d19cf5514f..b5c29f827914a478f594a9908230b9f44ab010a2 100644 --- a/uname.sh +++ b/uname.sh @@ -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