[squeak-dev] 3.11.3.2135 for Unix

Markus Lampert markuslampert at yahoo.com
Fri Sep 18 02:16:45 UTC 2009


Ian,

your changes work (for me), if you add the following loop:

...
bindir="`dirname \"$0\"`"
bindir="`canonic \"${bindir}\"`"
while test -L "${bindir}"; do
  bindir="`canonic \"${bindir}\"`"
done
...

The '-L' could also be a '-h'. Unfortunately I only have access to Linux, so I don't know about the portability of this. My problem here seems to be that I have a link to a link ...

Eliot,

tried your implementation and ran into the same problem, it only resolves the first layer. So I guess do_readlink would have to be run in a loop to resolve the whole cascade.

I realize that this is probably not the place for this discussion. Where should I have posted initially?

Have fun,
Markus



>
>From: Eliot Miranda <eliot.miranda at gmail.com>
>To: The general-purpose Squeak developers list <squeak-dev at lists.squeakfoundation.org>
>Sent: Thursday, September 17, 2009 2:22:04 PM
>Subject: Re: [squeak-dev] 3.11.3.2135 for Unix
>
>Hi Ian,
>
>
>    if it'll help you're welcome to add the attached to Squeak under the MIT license.  I wrote it for my own use years ago and it is all my own work, etc, etc.  Its pretty portable and more flexible than e.g. the Mac OS readlink.
>
>
>On Thu, Sep 17, 2009 at 1:57 PM, Ian Piumarta <piumarta at gmail.com> wrote:
>
>>>Hi Markus,
>>
>>>>Unfortunately GNU/Linux doesn't agree with the rest of the world about the flags (including -f) understood by readlink (and Solaris doesn't have it at all) so your suggestion isn't going to work.
>>
>>>>How about this instead?
>>
>>>>readlink="`which readlink`"
>>>>test -x "${readlink}" || readlink=echo
>>
>>>>canonic () {(
>>>>    cd  "`dirname     \"$1\"`"
>>>>    dir="`basename    \"$1\"`"
>>>>    cd  "`${readlink} \"${dir}\"`"
>>>>    pwd
>>>>)}
>>
>>>>bindir="`dirname \"$0\"`"
>>>>bindir="`canonic \"${bindir}\"`"
>>>>prefix="`dirname \"${bindir}\"`"
>>>>[...rest of file the same...]
>>
>>>>Cheers,
>>>>Ian
>>
>>
>>
>


      



More information about the Squeak-dev mailing list