Skip to content
This repository
Browse code

In Darwin, explicitly use system's "basename" command.

basename in MacPorts' coreutils port has only --help
and --version option.  Usually it is installed as gbasename so no
problem will occur, but one can install it +with_default_names variant
which also installs basename as a symbolic link to gbasename.  In that
case rvm will fail in building ruby interpreters.
  • Loading branch information...
commit eddda0d7482d4a1a7131441c8859c8b57ea34b24 1 parent ec137f2
OZAWA Sakuro authored committed

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. +2 2 scripts/utility
4 scripts/utility
@@ -66,7 +66,7 @@ __rvm_debug() {
66 66 $rvm_scripts_path/log "debug" "ARCHFLAGS: $ARCHFLAGS"
67 67 $rvm_scripts_path/log "debug" "LDFLAGS: $LDFLAGS"
68 68 $rvm_scripts_path/log "debug" "CFLAGS: $CFLAGS"
69   - $rvm_scripts_path/log "debug" "/Developer/SDKs/*:$(basename -a /Developer/SDKs/* | tr "\n" ',')"
  69 + $rvm_scripts_path/log "debug" "/Developer/SDKs/*:$(/usr/bin/basename -a /Developer/SDKs/* | tr "\n" ',')"
70 70 fi
71 71
72 72 for file_name in $(echo $rc_files) ; do
@@ -679,7 +679,7 @@ __rvm_make_flags() {
679 679 if [[ ! -z "$rvm_archflags" ]] ; then
680 680 ARCHFLAGS="$rvm_archflags" ; export ARCHFLAGS
681 681 # Use the latest sdk available.
682   - if [[ -z "$rvm_sdk" ]] ; then rvm_sdk="$(basename -a /Developer/SDKs/* | awk '/^M/' | sort | tail -n 1)" ; fi
  682 + if [[ -z "$rvm_sdk" ]] ; then rvm_sdk="$(/usr/bin/basename -a /Developer/SDKs/* | awk '/^M/' | sort | tail -n 1)" ; fi
683 683 CFLAGS="${CFLAGS:-"-isysroot /Developer/SDKs/$rvm_sdk $rvm_archflags"}" ; export CFLAGS
684 684 LDFLAGS="${LDFLAGS:-"-Wl,-syslibroot /Developer/SDKs/$rvm_sdk $rvm_archflags"}" ; export LDFLAGS
685 685 # CXXFLAGS="-mmacosx-version-min="$(sw_vers -productVersion | awk -F'.' '{print $1"."$2}')" -isysroot /Developer/SDKs/$rvm_sdk " ; export CXXFLAGS

0 comments on commit eddda0d

Please sign in to comment.
Something went wrong with that request. Please try again.