Robin H. Johnson wrote:
On Mon, Jun 08, 2009 at 12:00:59AM +0100, Roy Marples wrote:
Roy: [[ or [?
Entirely depends on system.
OpenRC uses /bin/sh to process the actual init script. We rely on /bin/sh
claiming POSIX compat [1]. On Gentoo Linux systems, this is normally a link
to bash, so you can use bashisms if you so wish.
Is "[[" a bashism or not? That's all I'm asking.
What's a good way to test for POSIX compatibility so that the testing
CAN actually be done. My testcase was 'bash --posix'. Testing under
busybox's ash seems to work perfectly with "[[" as well.
bash(1) only documents the --posix option to modify how bash starts up.
It does not mention restricting bash extensions such as [[
IIRC vapier patched busybox to alias [[ to [, which is worse as you
still have to quote correctly as if [ and you don't get the =~ operator
from [[.
But as you asked, here's what the good doc [1] has to say
The following words may be recognized as reserved words on some
implementations (when none of the characters are quoted), causing
unspecified results:
[[ ]] function select
In other words, I won/t make any claims whether [[ ]] works in OpenRC.
That doesn't answer if it's a bashism. I interpret that part of the
document to simply be that it's implementation detail is not covered by
the POSIX spec.
If it's not in the spec, then it has to be an extension. Thus, if bash
is extending it then it's a bashism.
I'm all for going with something that will work more globally, IFF it
can be easily tested for (on pure Gentoo Linux machines, which is what
most developers are running, because they won't be bothered to test
under G/FBSD or Prefix/OSX etc), vs. just going by what the
specification says.
The only available shell on Linux that doesn't do anything other than
the POSIX spec is dash. However, even that shell is not entirely
compliant (a few missing features last I looked).
Just Do What The Fuck You Like, Just Don't Bug Me pretty much somes up my
attitude right now. Why do I have this attiude? Well, bug #175783 is a very
good example. It's over two years since I submitted replacement scripts and
did more besides. It's just like the courier-imap fiasco when
baselayout-1.12 was touted for stable, but this time I Just Don't Care.
There hasn't been any release of the mysql-init-scripts in 2 years.
It's not that anything contrary to your opinions has been done on that
bug, it's more that I haven't have any specific need to fix that package
yet.
Other than the need to actually allow mysql to work on Gentoo/FreeBSD.
Ah, you've already said that you don't want to run anything other than
Linux. Fine, that's your choice, but please hand mysql over to someone
who cares about Gentoo running on alternative OS's as you've just
demonstrated you just don't care.
Thanks
Roy