summaryrefslogtreecommitdiffstats
path: root/sb
diff options
context:
space:
mode:
authorSachin Gupta <sgupta2m@in.ibm.com>2016-03-14 01:55:24 -0500
committerSachin Gupta <sgupta2m@in.ibm.com>2016-03-16 06:00:14 -0400
commitaa9944c7e4b268a458f1f28478d9772edf8af2d8 (patch)
tree593c928966a8eadadc76d4795c16eec7ea92257b /sb
parentfbbd7e9532defda49dbc265455228c7ae7d47312 (diff)
downloadtalos-sbe-aa9944c7e4b268a458f1f28478d9772edf8af2d8.tar.gz
talos-sbe-aa9944c7e4b268a458f1f28478d9772edf8af2d8.zip
Enable Workon tools
Change-Id: Ifedd4b64cc21d3f9ab7b652b8a737d1f94171b03 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/21965 Tested-by: Jenkins Server Reviewed-by: Santosh S. Puranik <santosh.puranik@in.ibm.com> Reviewed-by: RAJA DAS <rajadas2@in.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'sb')
-rwxr-xr-xsb61
1 files changed, 61 insertions, 0 deletions
diff --git a/sb b/sb
new file mode 100755
index 00000000..fe2c289b
--- /dev/null
+++ b/sb
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+sb_helptext()
+{
+ echo "SBE Utility Script"
+
+ case $1 in
+ workon)
+ echo " Topic 'workon'"
+ echo
+ echo " Usage:"
+ echo " sb workon"
+ echo
+ echo " Sources necessary environment files for building sbe"
+ echo " and begins a new shell. The workon may be left via 'exit'."
+ echo
+ echo " See also:"
+ echo " customrc"
+ ;;
+ *)
+ echo " Usage:"
+ echo " sb <cmd>"
+ echo " sb help [<cmd>|<topic>]"
+ echo
+ echo " Available Commands:"
+ echo " workon"
+ echo
+ esac
+}
+
+sb_workon()
+{
+ if [ -n "${SBE_INSIDE_WORKON}" ]; then
+ echo "Already in a workon."
+ exit -1
+ else
+ export SBE_INSIDE_WORKON=1
+ echo "Setting environment variables..."
+ source ./env.bash
+ echo "Spawning new shell with devtoolset 2..."
+ scl enable devtoolset-2 bash
+ fi
+}
+
+if [ 0 == $# ]; then
+ sb_helptext
+ exit -1
+fi
+
+FIRST_PARAM=$1
+shift
+
+case ${FIRST_PARAM} in
+workon)
+ sb_workon $*
+ ;;
+*)
+ sb_helptext $*
+ exit -1
+ ;;
+esac
OpenPOWER on IntegriCloud