renpy/renpy — pull request #196 by xiongchiamiov (2013-10-26 05:52:51+00:00)
Title: Port after_checkout.sh to non-Linux Unixes

`after_checkout.sh` has been using `readlink(1)` to get an absolute path (with
no symlinks) to the renpy root directory. Unfortunately, `readlink -f` is a
GNU extension, and thus unavailable on the BSDs, including OS X.

[There are][0] a number of options for those systems. While an exec out to
Python seems like overkill (and is, in fact, a bit slow on my system), the
delay is small enough to not be a problem in a one-time script like this.
Additionally, it seemed silly to include a dozen-line shell function just for
this one usage. Plus, we know for certain the user has Python, because
otherwise they couldn't run Ren'Py. ;)

I included the parens around `print` just to make sure it works with both
Python 2.x and 3.x. I doubt this matters, but I figured I might as well.

If we stop caring about resolving symlinks, this entire line [can be replaced][1]
with `$PWD##*`.

[0]: http://stackoverflow.com/q/1055671/120999
[1]: http://stackoverflow.com/a/1371283/120999