未验证 提交 bfaac567 编写于 作者: S Shaoqi Bai 提交者: GitHub

Merge pull request #10739 from greenplum-db/173498885-gphome-gp5

[backport 5X]GPHOME is determined dynamically when sourcing greenplum_path
上级 22448ff7
......@@ -1059,9 +1059,9 @@ greenplum_path:
mkdir -p $(INSTLOC)
ifeq ($(BLD_ARCH),$(filter $(BLD_ARCH),ubuntu1604_amd64))
# python is not vendored in the enterpise builds of Ubuntu 16.04
$(BUILDDIR)/gpMgmt/bin/generate-greenplum-path.sh $(INSTLOC) no > $(INSTLOC)/greenplum_path.sh
$(BUILDDIR)/gpMgmt/bin/generate-greenplum-path.sh no > $(INSTLOC)/greenplum_path.sh
else
$(BUILDDIR)/gpMgmt/bin/generate-greenplum-path.sh $(INSTLOC) yes > $(INSTLOC)/greenplum_path.sh
$(BUILDDIR)/gpMgmt/bin/generate-greenplum-path.sh yes > $(INSTLOC)/greenplum_path.sh
endif
copylicense:
......
......@@ -61,7 +61,7 @@ set_scripts_version :
generate_greenplum_path_file:
mkdir -p $(DESTDIR)$(prefix)
unset LIBPATH; \
bin/generate-greenplum-path.sh $(prefix) > $(DESTDIR)$(prefix)/greenplum_path.sh
bin/generate-greenplum-path.sh > $(DESTDIR)$(prefix)/greenplum_path.sh
install: generate_greenplum_path_file
# Generate some python libraries
......
......@@ -58,7 +58,7 @@ PYGRESQL_DIR=PyGreSQL-$(PYGRESQL_VERSION)
pygresql:
@echo "--- PyGreSQL"
. $(prefix)/greenplum_path.sh && unset PYTHONHOME && \
PATH=$(bindir):$$PATH && \
if [ `uname -s` = 'HP-UX' ]; then \
cd $(PYLIB_SRC)/$(PYGRESQL_DIR) && DESTDIR="$(DESTDIR)" CC="$(CC)" LDFLAGS="-L../../../../gpAux/ext/hpux_ia64/python-2.5.6/lib" python setup.py build; \
elif [ "$(BLD_ARCH)" = 'aix7_ppc_64' ]; then \
......
#!/usr/bin/env bash
if [ -z "$1" ]; then
printf "Must specify a value for GPHOME"
exit 1
fi
SET_PYTHONHOME="${2:-no}"
GPHOME_PATH="$1"
cat <<EOF
GPHOME="${GPHOME_PATH}"
SET_PYTHONHOME="${1:-no}"
cat <<"EOF"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
if [ ! -L "${SCRIPT_DIR}" ]; then
GPDB_DIR=$(basename "${SCRIPT_DIR}")
else
GPDB_DIR=$(basename "$(readlink "${SCRIPT_DIR}")")
fi
GPHOME=$(dirname "${SCRIPT_DIR}")/"${GPDB_DIR}"
EOF
if [ "${SET_PYTHONHOME}" = "yes" ]; then
......
#!/bin/sh
#!/usr/bin/env bash
if [ ! -z "$GPHOME" ]; then
. $GPHOME/greenplum_path.sh
fi
......
......@@ -2,23 +2,13 @@
set -e
echo "set GPHOME with first argument"
./generate-greenplum-path.sh /foo | grep -q 'GPHOME="/foo"'
echo "set PYTHONHOME if first argument is 'yes'"
./generate-greenplum-path.sh yes | grep -q 'PYTHONHOME="${GPHOME}/ext/python"'
echo "set PYTHONHOME if second argument is 'yes'"
./generate-greenplum-path.sh /foo yes | grep -q 'PYTHONHOME="${GPHOME}/ext/python"'
echo "do not set PYTHONHOME if first argument is not 'yes'"
[ $(./generate-greenplum-path.sh no | grep -c PYTHONHOME) -eq 0 ]
echo "do not set PYTHONHOME if second argument is not 'yes'"
[ $(./generate-greenplum-path.sh /foo no | grep -c PYTHONHOME) -eq 0 ]
echo "do not set PYTHONHOME if second argument is missing"
[ $(./generate-greenplum-path.sh /foo | grep -c PYTHONHOME) -eq 0 ]
echo "error out if no argument is given"
if ./generate-greenplum-path.sh; then
echo "should not have passed"
exit 1
fi
./generate-greenplum-path.sh | grep -q "Must specify a value for GPHOME"
echo "do not set PYTHONHOME if first argument is missing"
[ $(./generate-greenplum-path.sh | grep -c PYTHONHOME) -eq 0 ]
echo "ALL TEST PASSED"
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册