Skip to content

Commit

Permalink
Updated omnibus postinst script to symlink to appbundle created bin…
Browse files Browse the repository at this point in the history
…stubs (#2732)

* Updated `postinst` script to symlink to appbundle created binstubs
rather than rubygems binstubs in embedded directory.

The rubygems binstubs do not account for GEM_HOME or GEM_PATHS existing
in the invoking shell. This creates problems on systems with multiple
ruby versions. If GEM_HOME or GEM_PATH is set the rubygems embedded
binstubs will attempt to use this external gem source which will
generally result in errors for the user.

Signed-off-by: Miah Johnson <miah@chia-pet.org>
  • Loading branch information
miah authored and jquick committed Feb 28, 2018
1 parent af38fa7 commit 112f12d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
9 changes: 9 additions & 0 deletions ci/verify-inspec.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@ECHO OFF

REM ; Set GEM_HOME and GEM_PATH to verify our appbundle inspec shim is correctly
REM ; removing them from the environment while launching from our embedded ruby.
SET GEM_HOME=C:\SHOULD_NOT_EXIST
SET GEM_PATH=C:\SHOULD_NOT_EXIST

cd C:\opscode\inspec\bin
inspec version
11 changes: 11 additions & 0 deletions ci/verify-inspec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -evx

# Set GEM_HOME and GEM_PATH to verify our appbundle inspec shim is correctly
# removing them from the environment while launching from our embedded ruby.
export GEM_HOME=/SHOULD_NOT_EXIST
export GEM_PATH=/SHOULD_NOT_EXIST

export PATH=$PATH:/usr/local/bin
inspec version
2 changes: 1 addition & 1 deletion omnibus/package-scripts/inspec/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#

PROGNAME=`basename $0`
INSTALLER_DIR=/opt/inspec/embedded
INSTALLER_DIR=/opt/inspec
CONFIG_DIR=/etc/inspec
USAGE="usage: $0"

Expand Down

0 comments on commit 112f12d

Please sign in to comment.