Commit c6a552e7 authored by Paul Mucur's avatar Paul Mucur
Browse files

Solaris doesn't come with readlink so use greadlink if available instead....

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)
parent b1d097a8
Loading
Loading
Loading
Loading

bin/ruby-build

100755 → 100644
+5 −1
Original line number Diff line number Diff line
@@ -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