Sha256: 771425cc9207ff896a333b837ec7c5d5e0cb2b2f30acb82e5df5fd624fb58ff7

Contents?: true

Size: 1.3 KB

Versions: 23

Compression:

Stored size: 1.3 KB

Contents

#!/usr/bin/env bash

rvm_base_except="selector"

source "$rvm_path/scripts/base"

source "$rvm_path/scripts/patches"

lookup_patchset()
{

  local paths lookup_path

  if [[ -z "$1" ]]; then
    echo "Usage: rvm patchset show name"
    return 1
  fi

  paths=($(__rvm_ruby_string_paths_under "$rvm_path/patchsets"))

  for lookup_path in "${paths[@]}" ; do

    if [[ -s "$lookup_path/$1" ]]; then

      cat "$lookup_path/$1"

      return 0
    fi
  done

  return 1
}

# Return the full patch for a given patch.
__rvm_lookup_full_patch_path()
{

  local directory directories extension patch_path

  directories=($(__rvm_patch_lookup_path))

  # Absolute path, pwd and then finally the rvm patches 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
      fi

    done

  done

  return 1
}

usage()
{
  printf "

  Usage:

    rvm patchset {show,lookup} [patchset]

  Description:

    Tools for manipulating patchsets.

"
  return 1
}

args=($*)
action="${args[0]}"
patchset="${args[1]}"
args="$(echo ${args[@]:2}) " # Strip trailing / leading / extra spacing.

case "$action" in
  show|lookup) lookup_patchset "$patchset" ;;
  *) usage ;;
esac

exit $?

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
rvm-1.1.4 scripts/patchsets
rvm-1.1.3 scripts/patchsets
rvm-1.1.2 scripts/patchsets
rvm-1.1.1 scripts/patchsets
rvm-1.1.0 scripts/patchsets
rvm-1.0.23 scripts/patchsets
rvm-1.0.22 scripts/patchsets
rvm-1.0.21 scripts/patchsets
rvm-1.0.20 scripts/patchsets
rvm-1.0.19 scripts/patchsets
rvm-1.0.18 scripts/patchsets
rvm-1.0.17 scripts/patchsets
rvm-1.0.15 scripts/patchsets
gemrage-1.0.0 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/patchsets
gemrage-0.4.1 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/patchsets
gemrage-0.4.0 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/patchsets
gemrage-0.3.2 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/patchsets
gemrage-0.3.1 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/patchsets
gemrage-0.3.0 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/patchsets
gemrage-0.2.0 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/patchsets