Sha256: c4ac2f5e1f8d5e41a995bd298fa4426979a475f3f88d3311df4a44c85a62c9b2

Contents?: true

Size: 1.04 KB

Versions: 9

Compression:

Stored size: 1.04 KB

Contents

#!/usr/bin/env bash

# General tools for manipulating patches
# and dealing with patches.

# Returns the path used to look for a patch given a specific name.
__rvm_patch_lookup_path() {
  echo "/" 
  [[ -n "$rvm_patch_original_pwd" ]] && echo "$rvm_patch_original_pwd/"
  echo "$PWD/"
  __rvm_ruby_string_paths_under "$rvm_patches_path" | sed 's/$/\//'
}

__rvm_expand_patch_name() {
  [[ -z "$1" ]] && return
  expanded_patch_name="$($rvm_scripts_path/patchsets show "$1")"
  if [[ "$?" == "0" ]]; then
    echo "$expanded_patch_name"
  elif [[ "$1" != "default" ]]; then
    echo "$1"
  fi
  unset expanded_patch_name
}

# Return the full patch for a given patch.
__rvm_lookup_full_patch_path() {
  # Absolute path, pwd and then finally the rvm patches path.
  for directory in $(__rvm_patch_lookup_path) ; do
    for extension in {"",.patch,.diff}; do
      patch_path="${directory}${1}${extension}"
      if [[ -s "$patch_path" ]]; then
        echo "$patch_path"
        return
      fi
    done; unset extension patch_path
  done; unset directory
  return 1
}

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rvm-1.0.1 scripts/patches
rvm-1.0.0 scripts/patches
rvm-0.1.47 scripts/patches
rvm-0.1.46 scripts/patches
rvm-0.1.45 scripts/patches
rvm-0.1.44 scripts/patches
rvm-0.1.43 scripts/patches
rvm-0.1.42 scripts/patches
rvm-0.1.41 scripts/patches