Fw: [Vm-dev] unix start scripts, pwd and error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Fw: [Vm-dev] unix start scripts, pwd and error

Markus Lampert
 
Hi Randal, Ian, folks,

I have oversimplified the example below (apologies for the personal responses last night, it was not my intention to take the discussion off list).
The way described the script doesn't work, even with pwd -P (Ian also mentions that -P is not supported on Solaris, so I remembered that wrong).

I found an old version of the modified script which I've used as the basis for a version I've attached. The script works in cases where squeak itself is a symlink, or the directory in which squeak resides is accessed through a symlink. It also deals with links to links ...

Have fun,
Markus

edit: for some reason yahoo doesn't let me attach a file, so here just the changes (marked):
#!/bin/sh
#
# Launch squeakvm from the command line or a menu script, with a good
# plugin path, text encodings and pulseaudio kludge
#
# Last edited: 2009-08-27 22:25:34 by piumarta on emilia-2.local

PATH=/usr/bin:/bin

me=`basename $0`

# ------------------------- original -----------------------
#bindir=`dirname $0`
# ------------------- ml: resolve symlinks -------------
self=${0}
test -h "${self}" && self=`readlink ${self}`
bindir=`dirname ${self}`
while test -h "${bindir}"; do
  bindir=`dirname ${bindir}`/`readlink ${bindir}`;
done
# --------------------- end of changes ---------------------



----- Forwarded Message ----
> From: Markus Lampert
>
> Hi Randal,

I'm not demanding it, there are other solutions for the
> problem (pwd -P is just the simplest of them all).

If you access your vm
> through a symbolic link the script cannot determine the lib directory and
> doesn't find the plugins.
Lets assume you installed squeak in the directory
> /usr/local/squeak4.11/... (with ./bin, ./lib and ./share), and have a symbolic
> link:

/usr/local/bin/squeak ->
> /usr/local/squeak4.11/bin/squeak


If (in a setup like this) you just
> use 'pwd' the script will cd into /usr/local/bin and then try to find the vm and
> all plugins in /usr/local/lib/.... which doesn't quite work. If you use 'pwd -P'
> it cd's into /usr/local/squeak4.11/bin and then the ../lib/.... paths work as
> expected.

Have fun,
Markus



----- Original Message
> ----
> From: Randal L. Schwartz

pwd -P is a
> relatively
> modern invention.  I don't have a counter
example, but is
> there
> any reason you demand it?

What's wrong with just pwd?


 
>    
> __________________________________________________________________
Yahoo!
> Canada Toolbar: Search from anywhere on the web, and bookmark your favourite
> sites. Download it now

> >http://ca.toolbar.yahoo.com.


      __________________________________________________________________
Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now
http://ca.toolbar.yahoo.com.