scala/scala — pull request #648 by pvlugter (2012-06-01 07:34:40+00:00)
Title: More robust findScalaHome in bash scripts

While looking for the latest solution for resolving script locations, for a start script for the incremental compiler, I saw SI-5792 and the problem with relative symlinks.

Thinking about this problem, multiple relative symlinks also wouldn't work with the current fix. For example:

relative/scala -> ../bin/scala
relative/again/scala -> ../scala

Here's a more general solution for resolving symlinks, whether they're relative or absolute. It resolves by jumping through the directories on the way.

Review by @paulp.