scripts/patches in rvm-1.0.5 vs scripts/patches in rvm-1.0.6

- old
+ new

@@ -10,29 +10,47 @@ echo "$PWD/" __rvm_ruby_string_paths_under "$rvm_patches_path" | sed 's/$/\//' } __rvm_expand_patch_name() { - local name="$1" + local name expanded_patch_name + + name="${1:-""}" + [[ -z "$name" ]] && return 0 + expanded_patch_name="$("$rvm_scripts_path/patchsets" show "$name")" + if [[ "$?" == "0" ]]; then echo "${expanded_patch_name}" + elif [[ "$name" != "default" ]]; then echo "$name" - fi ; unset expanded_patch_name + fi + + return 0 } # Return the full patch for a given patch. __rvm_lookup_full_patch_path() { + local extension patch_path directory directories + # Absolute path, pwd and then finally the rvm patches path. - for directory in $(__rvm_patch_lookup_path) ; do + directories=($(__rvm_patch_lookup_path)) + + for directory in "${directories[@]}" ; do + for extension in {"",.patch,.diff}; do + patch_path="${directory}${1}${extension}" + if [[ -s "$patch_path" ]]; then echo "$patch_path" - return + return 0 fi - done; unset extension patch_path - done; unset directory + + done + + done + return 1 }