提交 3ca74bc2 编写于 作者: B Bradford D. Boyle 提交者: Shaoqi Bai

Fix greenplum_path script for OSS Ubuntu

We do not vendor python on OSS Ubuntu 16.04 and therefore
`$GPHOME/ext/python` doesn't exist. This causes the system python to
fail with an error message about not being able to find the site module.

This commit updates the logic in generate-greenplum_path.sh to check if
we are vendoring python and if we are, it includes setting `$PYTHONHOME`
in greenplum_path.sh. If we are vendoring python, then at build-time
`$PYTHONHOME` is set to point at our vendored python.

[#173046174]
Authored-by: NBradford D. Boyle <bradfordb@vmware.com>
上级 2a38b3d6
......@@ -9,10 +9,22 @@ GPHOME_PATH="$1"
cat <<EOF
GPHOME="${GPHOME_PATH}"
PYTHONHOME="${GPHOME}/ext/python"
EOF
if [ -x "${PYTHONHOME}/bin/python" ]; then
cat <<-"EOF"
PYTHONHOME="${GPHOME}/ext/python"
export PYTHONHOME
PATH="${PYTHONHOME}/bin:${PATH}"
LD_LIBRARY_PATH="${PYTHONHOME}/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
EOF
fi
cat <<"EOF"
PYTHONPATH="${GPHOME}/lib/python"
PATH="${GPHOME}/bin:${PYTHONHOME}/bin:${PATH}"
LD_LIBRARY_PATH="${GPHOME}/lib:${PYTHONHOME}/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
PATH="${GPHOME}/bin:${PATH}"
LD_LIBRARY_PATH="${GPHOME}/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
if [ -e "${GPHOME}/etc/openssl.cnf" ]; then
OPENSSL_CONF="${GPHOME}/etc/openssl.cnf"
......@@ -20,7 +32,6 @@ fi
export GPHOME
export PATH
export PYTHONHOME
export PYTHONPATH
export LD_LIBRARY_PATH
export OPENSSL_CONF
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册