From 08e55b9d8e6670b474c5c405020f5a3540f25eae Mon Sep 17 00:00:00 2001 From: Rob Dimsdale-Zucker Date: Wed, 29 Mar 2023 18:05:23 +0000 Subject: [PATCH] Install bootstrapped Ruby into php-buildpack specific location - This avoids clashing with existing ruby installations provided by other buildpacks, which are typically different versions of ruby than required by this buildpack Signed-off-by: Sophie Wigmore --- bin/detect | 2 +- bin/install-ruby | 6 +++--- bin/release | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/detect b/bin/detect index 2d3b9b0df..e4d9b3793 100755 --- a/bin/detect +++ b/bin/detect @@ -28,7 +28,7 @@ if [ "$CF_STACK" == "cflinuxfs4" ]; then mkdir -p "${PYTHON_DIR}" source "$BP/bin/install-python" "$PYTHON_DIR" "$BP" &> /dev/null - RUBY_DIR="/tmp/ruby" + RUBY_DIR="/tmp/php-buildpack/ruby" mkdir -p "${RUBY_DIR}" source "$BP/bin/install-ruby" "$RUBY_DIR" "$BP" &> /dev/null fi diff --git a/bin/install-ruby b/bin/install-ruby index c57d44888..cb3d1f94e 100755 --- a/bin/install-ruby +++ b/bin/install-ruby @@ -8,10 +8,10 @@ function main() { local buildpack_dir="$2" local ruby_dep_name=$(get_ruby_from_manifest "$buildpack_dir") - if [[ ! -d "/tmp/ruby/bin" ]]; then + if [[ ! -d "/tmp/php-buildpack/ruby/bin" ]]; then setup_ruby "$ruby_dep_name" "$install_dir" "$buildpack_dir" - elif [[ $install_dir != "/tmp/ruby" ]]; then - cp -r "/tmp/ruby/." "$install_dir" + elif [[ $install_dir != "/tmp/php-buildpack/ruby" ]]; then + cp -r "/tmp/php-buildpack/ruby/." "$install_dir" fi export PATH="$install_dir/bin:${PATH:-}" alias ruby=ruby3 diff --git a/bin/release b/bin/release index 57eab4f5f..86fd58967 100755 --- a/bin/release +++ b/bin/release @@ -30,7 +30,7 @@ if [ "$CF_STACK" == "cflinuxfs4" ]; then mkdir -p "${PYTHON_DIR}" source "$BP/bin/install-python" "$PYTHON_DIR" "$BP" &> /dev/null - RUBY_DIR="/tmp/ruby" + RUBY_DIR="/tmp/php-buildpack/ruby" mkdir -p "${RUBY_DIR}" source "$BP/bin/install-ruby" "$RUBY_DIR" "$BP" &> /dev/null fi