Alexander Gerasiov wrote on 26/09/2005 15:46:
> Man, you still didn't checked your script with posh %)

That's mainly because posh is inherently broken. It claims to restrict
itself to the Posix standard for shells but it doesn't. Best example is
the first issue you name below (see there for explanation).

> I've fixed some issues i found:
> 
> # diff /etc/init.d/spampd /etc/init.d/spampd.posix

Note that unified diffs (diff -u) are both easier to read and easier to
integrate into existing sources than "standard" diffs.

> 26c26
> < function istrue () {
> ---
> 
>>istrue () {
> 
> 28c28
> <     [ "$ANS" = 'yes' -o "$ANS" = 'true' -o "$ANS" = 'enable' -o "$ANS" = 
> '1' ]
> ---
> 
>>    [ "$ANS" = "yes" ] || [ "$ANS" = "true" ] || [ "$ANS" = "enable" ] || [ 
>> "$ANS" = "1" ]


This is a problem of posh: It overrides the test binary - via its [
alias - (which supports -o), but doesn't provide what that binary
provides. Shell-Builtins are not part of the Posix shell standard. If
posh would indeed restrict itself to what the Posix shell standard says,
the above line won't be a problem for users of posh.
Also, given the fact that posh is nothing but a testbed, I'm not going
to adjust my scripts to posh just to be able to run posh as /bin/sh. Use
any _reasonable_, posix compliant shell (ash, bash, ksh,...). They _all_
 (every shell I tested, except for posh) also provide a built-in for
test (resp. [), which supports the -o extension to the test binary given
in Posix standards documents as being optional (to the posix conformant
[/test binary, not to a shell).
This problem has been discussed a lot in the BTS already, though I
currently can't give you a pointer.

To summarize:
Providing a [/test builtin in a shell is neither recommended nor
required by Posix standards. Posh deliberately provides such a builtin,
overriding an existing binary. That binary is priority required (package
coreutils), and my scripts rely on functionality given by that binary.
If posh decides to override the implementation given in that binary,
it's posh's job to provide at least the same functionality as that
binary, otherwise it is a bug in posh, not in my package.

> 83,84c83,84
> < function check_pid () {
>>check_pid () {

This one, I will fix.
However, you might want to create a wishlist (or higher) bug report
against the devscripts package (checkbashism script) to add a test for
this. But on the other hand, I seem to remember that the "function "
part of the declaration is named as being optional (to the user, not the
shell) in the posix standards. But I'm not sure here and too lazy to
look it up, so I change it as requested.
> 115c115
> <               if [ "$?" == '0' ]; then
>>              if [ "$?" = '0' ]; then
> 131c131
> <                               --pidfile $PIDFILE >& /dev/null
>>                              --pidfile $PIDFILE > /dev/null

These, I will also fix. Though I won't fix the latter like you suggested
(redirecting all output is done for a reason;-)). And the former is
already fixed in the version I have on my system.

cu,
sven


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to