From c6a552e793406bf8916263bfb326251fce8a7fe5 Mon Sep 17 00:00:00 2001 From: Paul Mucur Date: Tue, 16 Aug 2011 23:22:52 +0200 Subject: [PATCH] Solaris doesn't come with readlink so use greadlink if available instead. (Taken from Ryan Tomayko's "GNU is killing Solaris", c.f. http://tomayko.com/writings/gnu-is-killing-solaris) --- bin/ruby-build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) mode change 100755 => 100644 bin/ruby-build diff --git a/bin/ruby-build b/bin/ruby-build old mode 100755 new mode 100644 index d5cad326..e6fd63b7 --- a/bin/ruby-build +++ b/bin/ruby-build @@ -3,6 +3,10 @@ set -E exec 3<&2 # preserve original stderr at fd 3 +resolve_link() { + $(type -p greadlink readlink | head -1) $1 +} + abs_dirname() { local cwd="$(pwd)" local path="$1" @@ -10,7 +14,7 @@ abs_dirname() { while [ -n "$path" ]; do cd "${path%/*}" local name="${path##*/}" - path="$(readlink "$name" || true)" + path="$(resolve_link "$name" || true)" done pwd