Message ID | 20220606113649.41600-1-zhaogongyi@huawei.com |
---|---|
State | Accepted |
Headers | show |
Series | tst_kvercmp.sh: strip '+' when $(EXTRAVERSION) is blank | expand |
Hi Zhao, > $(EXTRAVERSION) defines an even tinier sublevel for pre-patches > or additional patches. It is usually some non-numeric string > such as "-pre4", and is often blank. When $(EXTRAVERSION) is blank, > there may be a extra '+' which shoud be stripped. ... > r3=${r3%%-*} > +r3=${r3%%+*} Is that '+' on kernel which sources were modified without commit? This can be on version with non-blank EXTRAVERSION, but in that case it's already removed by r3=${r3%%-*}, right? LGTM Reviewed-by: Petr Vorel <pvorel@suse.cz> Kind regards, Petr
diff --git a/testcases/open_posix_testsuite/scripts/tst_kvercmp.sh b/testcases/open_posix_testsuite/scripts/tst_kvercmp.sh index 69466bb12..ce1d13c72 100755 --- a/testcases/open_posix_testsuite/scripts/tst_kvercmp.sh +++ b/testcases/open_posix_testsuite/scripts/tst_kvercmp.sh @@ -10,6 +10,7 @@ r1=$(echo ${ker_ver} | awk -F. '{print $1}') r2=$(echo ${ker_ver} | awk -F. '{print $2}') r3=$(echo ${ker_ver} | awk -F. '{print $3}') r3=${r3%%-*} +r3=${r3%%+*} test_ver=$(($1 * 65536 + $2 * 256 + $3)) curr_ver=$((${r1} * 65536 + ${r2} * 256 + ${r3}))
$(EXTRAVERSION) defines an even tinier sublevel for pre-patches or additional patches. It is usually some non-numeric string such as "-pre4", and is often blank. When $(EXTRAVERSION) is blank, there may be a extra '+' which shoud be stripped. Signed-off-by: Zhao Gongyi <zhaogongyi@huawei.com> --- testcases/open_posix_testsuite/scripts/tst_kvercmp.sh | 1 + 1 file changed, 1 insertion(+) -- 2.17.1