[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#245643: libc6: problem with $kernel_ver in preinst



At Sun, 25 Apr 2004 14:11:23 +0200,
Gregory Colpart wrote:
> > This problem should be fixed in -12.  See #241395.
> 
> It is not fixed for me:
> The version -12 fixes the kernel x.y.zfoo
> But I have numbers after foo: x.y.zfooA where A is a number
> 
> Then with the new preinst:
> $ cat  glibc_2.3.2.ds1-12.diff | grep kernel_rev
> +    kernel_rev=$(uname -r | tr -- - . | cut -d. -f3 | tr -d
> '[:alpha:]')
> +    if [ "$kernel_rev" -ge 255 ]
> 
> It gives me: zA and it is incorrect
> 
> If sed can be use, it can be:
> kernel_rev=$(uname -r | sed 's/[^\.]\+\.[^\.]\+\.\([^[:alpha:]]\).*/\1/')

You're right.

Goswin von Brederlow proposed the below pattern in #241395:

	kernel_rev=$(uname -r | sed 's/\([0-9]*\.[0-9]*\.\)\([0-9]*\)\(.*\)/\2/')

I adopt these.

Regards,
-- gotom



Reply to: