Re: [LTP] [PATCH] tst_kvercmp.sh: strip '+' when $(EXTRAVERSION) is blank

zhaogongyi via ltp
2022-06-07T02:15:17Z

Hi Petr,

Yes, if EXTRAVERSION is set to "-*", it has been stripped, but EXTRAVERSION also can be set to blank and sources were modified without commit, In this case,
we run 'make clean' or 'make' would report error like:

./scripts/tst_kvercmp.sh: line 16: 5 * 65536 + 10 * 256 + 0+: syntax error: operand expected (error token is "+")
./scripts/tst_kvercmp.sh: line 17: [: -ge: unary operator expected

Best wishes,
Gongyi

>
> 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