Re: [PATCH/RFC] eradicate bashisms in scripts/patch-kernel

From: Andreas Mohr
Date: Fri Nov 02 2007 - 16:09:46 EST


Hi,

On Fri, Nov 02, 2007 at 10:01:18AM +0800, Herbert Xu wrote:
> On Thu, Nov 01, 2007 at 04:08:57PM -0700, Randy Dunlap wrote:
> > I think that this is the part that bothers me. I can't find
> > anything at
> > http://www.opengroup.org/onlinepubs/000095399/utilities/xcu_chap02.html
> > that says that this:
> > EXTRAVER=${EXTRAVER%%[[:punct:]]*}
> >
> > is invalid or even optional syntax. OTOH, it does list such syntax,
>
> This is POSIX-compliant and has worked with dash from the very
> start.

True (just verified again). But then I didn't actually say that this line
is problematic. Since I had to replace the leading . replacement part already
I decided to simply fold everything into one sed expression.

> Using variables without dollar signs in arithmetic expansion was
> only added to dash very recently. So please please talk to your
> distribution maker to update their dash packages and it will work
> correctly.

"Debian stable.", aka "Update not an option.". Right?

Since the specs list both possibilities I'd simply go with the safe one,
the one that works on older dash versions, too.
Unless adding a $ sign happens to break other equally important
shells...

> This usage is compliant with the most recent revision of POSIX
> while earlier ones did not specifically require this (due to
> the fact that assignment support was not required either).

This is where I'd think the problem is. If dash once upon a time
decided to support the $ variant only and the specs didn't list both
at that time, well...

The dash version on my system is 0.5.3-5, BTW. Even Debian testing
has 0.5.3-7 only.
I'm now quite certain on which side to tweak things ;)

Thanks a lot for your review,

Andreas Mohr
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/