Re: portability improvements for wineshelllink script

2005-05-07 Thread Dan Kegel
Somebody wrote:
> [Let's use bash features in wine shell scripts]
Bad idea.  Unless you have a *very* good reason,
you should stick to Posix interfaces, which here
means "get it to run under Bourne shell".
Portability -- it's a good thing.
By the way, if anyone out there is looking for
a concise, illuminating guide to portable shell
scripting, I highly recomment "Portable Shell Programming"
by Bruce Blinn.
- Dan
--
Trying to get a job as a c++ developer?  See 
http://kegel.com/academy/getting-hired.html


Re: portability improvements for wineshelllink script

2005-05-07 Thread Robert Lunnon
On Sun, 8 May 2005 03:30 am, Dustin Navea wrote:
> Francois Gouget wrote:
> > This is true too but I think most Wine developers will agree with me
> > that Wine should not depend on bash which means the above is not 'the
> > right fix(tm)' which makes it 'the wrong fix'.
>
> Of course The Microsoft Fix(tm) would be to say "ahh to hell with it.
> Lets make our own proprietary shell and require that everyone using our
> product use that" :-D *ducks and runs for cover* I feel the heat of your
> flames already!
>
> Dustin

yes, they should all be written using command.com or cmd.exe, honest thay 
should .-)

Bob



Re: portability improvements for wineshelllink script

2005-05-07 Thread Dustin Navea
Francois Gouget wrote:
This is true too but I think most Wine developers will agree with me 
that Wine should not depend on bash which means the above is not 'the 
right fix(tm)' which makes it 'the wrong fix'.
Of course The Microsoft Fix(tm) would be to say "ahh to hell with it. 
Lets make our own proprietary shell and require that everyone using our 
product use that" :-D *ducks and runs for cover* I feel the heat of your 
flames already!

Dustin


Re: portability improvements for wineshelllink script

2005-05-07 Thread Francois Gouget
On Sat, 7 May 2005, Robert Lunnon wrote:
On Sat, 7 May 2005 08:52 pm, Francois Gouget wrote:
On Sat, 7 May 2005, Robert Lunnon wrote:
[...]
# diff -u wineshelllink.old  wineshelllink
--- wineshelllink.old   mer mai   4 11:47:30 2005
+++ wineshelllink   mer mai   4 11:50:03 2005
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
[...]
Wrong? Well actually, bash is wrong, it doesn't properly emulate Bourne shell
behaviour when called as sh, a constant source of irritation for Solaris
users I assure you.
It irritates *BSD users too.
[...]
Let's agree the solution is not necessarily *Wrong*, It does in fact work, so
it can't be wrong.
It is wrong because Wine should not depend on bash.

The script as written is bash feature bound,
This is wrong and must be fixed, not 'swept under the carpet'.

and therefore should be executed by bash.  What you really mean is 
that Laurent didn't fix the problem the way you wanted it to be fixed.
This is true too but I think most Wine developers will agree with me 
that Wine should not depend on bash which means the above is not 'the 
right fix(tm)' which makes it 'the wrong fix'.


BTW I  have no objection to making wine dependent on bash,
I have a strong objection as I'm sure many other developers do.

bash is available
for all platforms and is probably more regular than bourne shell across
platforms, though I think perhaps perhaps ksh might be a safer standard shell
choice
Putting '/bin/bash' is just as wrong as putting '/bin/ksh'. If you did 
the latter that script would fail to run on 90% of Linux systems. If you 
did the former it would certainly fail to run on a good number of *BSD 
systems (owned by persons alergic to bash) and maybe some Linux systems 
too.

[...]
Maybe there are other thoughts out there on which interpreter would be best
for wine's purposes.
'/bin/sh' is the right interpreter, there's simply no doubt about it.

Perhaps Laurent  might be willing to take a look at the bash dependencies, if
not I'll add it to my patch list to be maintained outside the wine project
until I get around to looking at it.
Yes, it seems Laurent is in a pretty good position to fix this script 
since his '/bin/sh' does not point to bash.

--
Francois Gouget [EMAIL PROTECTED]http://fgouget.free.fr/
 "Only wimps use tape backup: _real_ men just upload their important stuff on
   ftp, and let the rest of the world mirror it ;)" -- Linus Torvalds


Re: portability improvements for wineshelllink script

2005-05-07 Thread Robert Lunnon
On Sat, 7 May 2005 08:52 pm, Francois Gouget wrote:
> On Sat, 7 May 2005, Robert Lunnon wrote:
> [...]
>
> > # diff -u wineshelllink.old  wineshelllink
> > --- wineshelllink.old   mer mai   4 11:47:30 2005
> > +++ wineshelllink   mer mai   4 11:50:03 2005
> > @@ -1,4 +1,4 @@
> > -#!/bin/sh
> > +#!/bin/bash
>
> This is wrong. Some users may not have bash installed and the script
> should still work on their systems. So the fix is not to make the
> script fail to run on any system which does not have bash but to
> modify it so it works with any standard Bourne shell, including the
> Solaris one.

Wrong? Well actually, bash is wrong, it doesn't properly emulate Bourne shell 
behaviour when called as sh, a constant source of irritation for Solaris 
users I assure you. So the "Correct" fix is to fix bash, but then doing that 
will break half of linux.  Now you see why I choose Solaris...   But this is 
besides the point. 

Let's agree the solution is not necessarily *Wrong*, It does in fact work, so 
it can't be wrong. The script as written is bash feature bound, and therefore 
should be executed by bash.  What you really mean is that Laurent didn't fix 
the problem the way you wanted it to be fixed. 

BTW I  have no objection to making wine dependent on bash, bash is available 
for all platforms and is probably more regular than bourne shell across 
platforms, though I think perhaps perhaps ksh might be a safer standard shell  
choice and it's more likely to be closer than /bin/sh to being able to parse 
bash dependent scripts properly.

Maybe there are other thoughts out there on which interpreter would be best 
for wine's purposes.

Perhaps Laurent  might be willing to take a look at the bash dependencies, if 
not I'll add it to my patch list to be maintained outside the wine project 
until I get around to looking at it.


Bob



Re: portability improvements for wineshelllink script

2005-05-07 Thread Francois Gouget
On Sat, 7 May 2005, Robert Lunnon wrote:
[...]
# diff -u wineshelllink.old  wineshelllink
--- wineshelllink.old   mer mai   4 11:47:30 2005
+++ wineshelllink   mer mai   4 11:50:03 2005
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
This is wrong. Some users may not have bash installed and the script 
should still work on their systems. So the fix is not to make the 
script fail to run on any system which does not have bash but to 
modify it so it works with any standard Bourne shell, including the 
Solaris one.

--
Francois Gouget [EMAIL PROTECTED]http://fgouget.free.fr/
 Linux: the choice of a GNU generation