提交 40fc0e2d 编写于 作者: D David Sharp

add function to expand glob and ensure file exists

Signed-off-by: NJingyi Mei <jmei@pivotal.io>
上级 1694440c
...@@ -7,6 +7,12 @@ GPDB_ARTIFACTS_DIR=$(pwd)/$OUTPUT_ARTIFACT_DIR ...@@ -7,6 +7,12 @@ GPDB_ARTIFACTS_DIR=$(pwd)/$OUTPUT_ARTIFACT_DIR
CWDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" CWDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
function expand_glob_ensure_exists() {
local -a glob=($*)
[ -e "${glob[0]}" ]
echo "${glob[0]}"
}
function prep_env_for_centos() { function prep_env_for_centos() {
case "$TARGET_OS_VERSION" in case "$TARGET_OS_VERSION" in
5) 5)
...@@ -43,7 +49,7 @@ function prep_env_for_centos() { ...@@ -43,7 +49,7 @@ function prep_env_for_centos() {
} }
function prep_env_for_sles() { function prep_env_for_sles() {
export JAVA_HOME="$(ls -1d /usr/java/jdk1.7* | tail -1)" export JAVA_HOME=$(expand_glob_ensure_exists /usr/java/jdk1.7*)
export PATH=${JAVA_HOME}/bin:${PATH} export PATH=${JAVA_HOME}/bin:${PATH}
source /opt/gcc_env.sh source /opt/gcc_env.sh
} }
...@@ -71,9 +77,7 @@ function make_sync_tools() { ...@@ -71,9 +77,7 @@ function make_sync_tools() {
} }
function link_tools_for_sles() { function link_tools_for_sles() {
local -a python_dirs=( "$(pwd)"/gpdb_src/gpAux/ext/*/python-2.7.12 ) ln -sf "$(expand_glob_ensure_exists "$(pwd)"/gpdb_src/gpAux/ext/*/python-2.7.12 )" /opt
[ -d "${python_dirs[0]}" ]
ln -sf "${python_dirs[0]}" /opt
} }
function build_gpdb() { function build_gpdb() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册