winelauncher patch

Jeremy White jwhite at codeweavers.com
Tue Mar 6 14:05:01 CST 2001


Ove,

I have in fact determined why I did not use which:
On Suse (and Caldera, I believe), 
which /usr/bin/wine returns an error string,
making the whole script go straight down the drain.

What was wrong with the previous implemenation?
Are you getting a $0 value that doesn't include
the path?  In all of the test cases I have,
invoking wine seems to bring in a $0 that includes
enough of the path for the find logic to work.

Jer

> Hunk 2:
> real_name=`find $0` don't find anything if the user typed "wine" or
> something, wine is in /usr/bin, which is in PATH, but the cwd is ~...
> rather run it through `which $0` first. Also, the symlink it's reading
> don't have to be absolute (my symlinks are relative), deal with that.
> 

> -real_name=`find $0 -type l -printf "%l\n"`
> +argv0_path=`which $0`
> +if [ -z $argv0_path ] ; then
> +    argv0_path=$0
> +fi
> +
> +real_name=`find $argv0_path -type l -printf "%l\n"`
>  if [ ! $real_name ]; then
> -    real_name=$0;
> +    real_name=$argv0_path
> +elif [ ! -x $real_name ]; then
> +    real_name=`find $argv0_path -printf "%h\n"`/$real_name
>  fi
> +
>  argv0_dir=`find $real_name -printf "%h\n"`
> 
>  if [ -z $argv0_dir ] ; then
> @@ -130,7 +138,7 @@
>      WINESERVER=$WINEBIN/server/wineserver
>  fi




More information about the wine-devel mailing list