diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-12-15 17:25:28 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-12-15 17:25:28 +0000 |
commit | 6b933047f46efec1aa747570f945344254227457 (patch) | |
tree | a12a4b87b38f954c4de435272cf4b90d721df5e8 /app-emulation/vagrant/files | |
parent | f45955e60d4da9b7f4a1088c98042f9c06669039 (diff) |
gentoo resync : 15.12.2017
Diffstat (limited to 'app-emulation/vagrant/files')
-rw-r--r-- | app-emulation/vagrant/files/vagrant.in-r1 | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/app-emulation/vagrant/files/vagrant.in-r1 b/app-emulation/vagrant/files/vagrant.in-r1 index 7c0405e8a835..134cb31f299c 100644 --- a/app-emulation/vagrant/files/vagrant.in-r1 +++ b/app-emulation/vagrant/files/vagrant.in-r1 @@ -5,16 +5,27 @@ # so that everything loads and compiles to proper directories. for r in ruby24 ruby23 ruby22; do + # not all ruby versions are guaranteed to be installed + if ! command -v "${r}" >/dev/null 2>&1; then + continue + fi + VAGRANT_DIR="$( "${r}" -e 'print Gem::default_path[-1] + "/gems/vagrant-@VAGRANT_VERSION@"' )" + # Export the VAGRANT_EXECUTABLE so that pre-rubygems can optimize a bit export VAGRANT_EXECUTABLE="${VAGRANT_DIR}/bin/vagrant" - "${r}" "${VAGRANT_EXECUTABLE}" "version" &> /dev/null - if [ $? -eq 0 ]; then + + if [ -f ${VAGRANT_EXECUTABLE} ] ;then ruby="${r}" break fi done +if [ -z ${ruby} ]; then + echo "Error: failed to find any usable ruby" + exit 1 +fi + # Export GEM_HOME based on VAGRANT_HOME # # This needs to be set because Bundler includes gem paths |