summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan McLellan <btm@loftninjas.org>2015-12-16 18:07:06 -0500
committerBryan McLellan <btm@loftninjas.org>2015-12-16 18:07:06 -0500
commit8153e5e074fa59503eac97576466616d30252a82 (patch)
tree79729aa40dc5c76738313c37953766b441c3910d
parent98be01d402fd96352b39e22124d3e97bd3111442 (diff)
parent81d8260401d9d4f9a0d5d6ba6ee4953a308b7303 (diff)
downloadchef-8153e5e074fa59503eac97576466616d30252a82.tar.gz
Merge pull request #565 from chef/btm/fix-postinst
Do not use bash arrays in verify-chef.sh
-rwxr-xr-xjenkins/verify-chef.sh30
1 files changed, 21 insertions, 9 deletions
diff --git a/jenkins/verify-chef.sh b/jenkins/verify-chef.sh
index b2c48651c2..9459c9efe6 100755
--- a/jenkins/verify-chef.sh
+++ b/jenkins/verify-chef.sh
@@ -5,6 +5,9 @@
PATH=/opt/$PROJECT_NAME/bin:$PATH
export PATH
+BIN_DIR=/opt/$PROJECT_NAME/bin
+export BIN_DIR
+
# We don't want to add the embedded bin dir to the main PATH as this
# could mask issues in our binstub shebangs.
EMBEDDED_BIN_DIR=/opt/$PROJECT_NAME/embedded/bin
@@ -20,16 +23,25 @@ fi
export USR_BIN_DIR
# sanity check that we're getting the correct symlinks from the pre-install script
-linked_binaries=( "chef-client" "knife" "chef-solo" "ohai" )
+if [ `readlink $USR_BIN_DIR/chef-client` != "$BIN_DIR/chef-client" ]; then
+ echo "$USR_BIN_DIR/chef-client symlink to $BIN_DIR/chef-client was not correctly created by the pre-install script!"
+ exit 1
+fi
-for i in "${linked_binaries[@]}"
-do
- LINK_TARGET=`readlink $USR_BIN_DIR/$i`
- if [ "$LINK_TARGET" != "$EMBEDDED_BIN_DIR/$i" ]; then
- echo "$USR_BIN_DIR/$i symlink to $EMBEDDED_BIN_DIR/$i was not correctly created by the pre-install script!"
- exit 1
- fi
-done
+if [ `readlink $USR_BIN_DIR/knife` != "$BIN_DIR/knife" ]; then
+ echo "$USR_BIN_DIR/knife symlink to $BIN_DIR/knife was not correctly created by the pre-install script!"
+ exit 1
+fi
+
+if [ `readlink $USR_BIN_DIR/chef-solo` != "$BIN_DIR/chef-solo" ]; then
+ echo "$USR_BIN_DIR/chef-solo symlink to $BIN_DIR/chef-solo was not correctly created by the pre-install script!"
+ exit 1
+fi
+
+if [ `readlink $USR_BIN_DIR/ohai` != "$BIN_DIR/ohai" ]; then
+ echo "$USR_BIN_DIR/ohai symlink to $BIN_DIR/ohai was not correctly created by the pre-install script!"
+ exit 1
+fi
# Ensure the calling environment (disapproval look Bundler) does not
# infect our Ruby environment created by the `chef-client` cli.