Skip to content

Commit

Permalink
Resolve problems installing with sudo
Browse files Browse the repository at this point in the history
  • Loading branch information
smcmahon committed Mar 6, 2018
1 parent 93379da commit ac6a7c4
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 21 deletions.
10 changes: 10 additions & 0 deletions HISTORY.txt
@@ -1,3 +1,13 @@
5.1.0r1 2018-03-06

- For good reason, a recent change in sudo does not allow overwriting PWD.
That fouled up the installer's scheme for keeping track of the installer directory, causing helper scripts to be lost.
Fixed.
[smcmahon]

- Packages included with the first 5.1.0 installer did not include some recipes used when installing via sudo.
[smcmahon]

5.1.0 2018-03-02

- Add to update_packages.py a mechanism to replace binary wheels with source tarballs.
Expand Down
2 changes: 1 addition & 1 deletion buildme.sh
Expand Up @@ -30,7 +30,7 @@ fi

BASE_VER=5.1.0
NEWVER=${BASE_VER}
INSTALLER_REVISION=""
INSTALLER_REVISION="-r1"

SDIR=`pwd`

Expand Down
3 changes: 3 additions & 0 deletions buildout_templates/buildout.cfg
Expand Up @@ -198,6 +198,9 @@ zeo-address = 127.0.0.1:8100
setuptools =
zc.buildout =

plone.recipe.command = 1.1
plone.recipe.precompiler = 0.6

Products.DocFinderTab = 1.0.5
bobtemplates.plone = 2.0
buildout.sanitycheck = 1.0.2
Expand Down
33 changes: 16 additions & 17 deletions helper_scripts/main_install_script.sh
Expand Up @@ -2,6 +2,8 @@
# Copyright (c) 2008-2017 Plone Foundation. Licensed under GPL v 2.
#

INSTALLER_PWD=`pwd`

# Path for Root install
#
# Path for server-mode install of Python/Zope/Plone
Expand Down Expand Up @@ -34,10 +36,10 @@ PLONE_GROUP=plone_group
readonly FOR_PLONE=5.1.0
readonly WANT_PYTHON=2.7

readonly PACKAGES_DIR=packages
readonly PACKAGES_DIR="${INSTALLER_PWD}/packages"
readonly ONLINE_PACKAGES_DIR=opackages
readonly HSCRIPTS_DIR=helper_scripts
readonly TEMPLATE_DIR=buildout_templates
readonly HSCRIPTS_DIR="${INSTALLER_PWD}/helper_scripts"
readonly TEMPLATE_DIR="${INSTALLER_PWD}/buildout_templates"

readonly PYTHON_URL=https://www.python.org/ftp/python/2.7.14/Python-2.7.14.tgz
readonly PYTHON_MD5=cee2e4b33ad3750da77b2e85f2f8b724
Expand All @@ -58,7 +60,7 @@ case $LANG in
# ;;
*)
# default to English
. helper_scripts/locales/en/LC_MESSAGES/messages.sh
. "${HSCRIPTS_DIR}/locales/en/LC_MESSAGES/messages.sh"
;;
esac

Expand All @@ -73,12 +75,9 @@ else
fi


# normalize
PWD=`pwd`
CWD="$PWD"
PKG="$CWD/$PACKAGES_DIR"
PKG="$PACKAGES_DIR"

. helper_scripts/shell_utils.sh
. "${INSTALLER_PWD}/helper_scripts/shell_utils.sh"

usage () {
eval "echo \"$USAGE_MESSAGE\""
Expand Down Expand Up @@ -108,7 +107,7 @@ INSTALL_ZEO=0

USE_WHIPTAIL=0
if [ "$BASH_VERSION" ] && [ "X$1" == "X" ]; then
. helper_scripts/whipdialog.sh
. "${INSTALLER_PWD}/helper_scripts/whipdialog.sh"
USE_WHIPTAIL=1
fi

Expand Down Expand Up @@ -530,8 +529,8 @@ PY_DIR=`dirname "$WITH_PYTHON"`
PY_BASE=`basename "$WITH_PYTHON"`
cd "$PY_DIR"
PY_DIR=`pwd`
cd "$INSTALLER_PWD"
WITH_PYTHON="${PY_DIR}/${PY_BASE}"
echo "$WITH_PYTHON"


#############################
Expand Down Expand Up @@ -666,7 +665,7 @@ if [ "X$DEBUG_OPTIONS" = "Xyes" ]; then
echo "DAEMON_USER=$DAEMON_USER"
echo "BUILDOUT_USER=$BUILDOUT_USER"
echo "ORIGIN_PATH=$ORIGIN_PATH"
echo "PWD=$PWD"
echo "PWD=$INSTALLER_PWD"
echo "CWD=$CWD"
echo "PKG=$PKG"
echo "WITH_PYTHON=$WITH_PYTHON"
Expand Down Expand Up @@ -720,7 +719,7 @@ eval "echo \"$INSTALLING_NOW\""
# create os users for root-level install
if [ $ROOT_INSTALL -eq 1 ]; then
# source user/group utilities
. helper_scripts/user_group_utilities.sh
. "${INSTALLER_PWD}/helper_scripts/user_group_utilities.sh"

# see if we know how to do this on this platfrom
check_ug_ability
Expand Down Expand Up @@ -798,7 +797,7 @@ if [ "X$BUILD_PYTHON" = "Xyes" ]; then

PY_HOME="$PLONE_HOME/Python-${WANT_PYTHON}"
WITH_PYTHON="${PY_HOME}/bin/python"
. helper_scripts/build_python.sh
. "${INSTALLER_PWD}/helper_scripts/build_python.sh"


if "$WITH_PYTHON" "$CWD/$HSCRIPTS_DIR"/checkPython.py --without-ssl=${WITHOUT_SSL}; then
Expand Down Expand Up @@ -896,9 +895,9 @@ cd "$CWD"
# we'll need into a tmp directory inside the install destination.
WORKDIR="${PLONE_HOME}/tmp"
mkdir "$WORKDIR" > /dev/null 2>&1
cp -R ./buildout_templates "$WORKDIR"
cp -R ./base_skeleton "$WORKDIR"
cp -R ./helper_scripts "$WORKDIR"
cp -R "${INSTALLER_PWD}/buildout_templates" "$WORKDIR"
cp -R "${INSTALLER_PWD}/base_skeleton" "$WORKDIR"
cp -R "${INSTALLER_PWD}/helper_scripts" "$WORKDIR"
if [ $ROOT_INSTALL -eq 1 ]; then
chown -R "$BUILDOUT_USER:$PLONE_GROUP" "$WORKDIR"
find "$WORKDIR" -type d -exec chmod g+s {} \;
Expand Down
4 changes: 2 additions & 2 deletions install.sh
Expand Up @@ -84,8 +84,8 @@
ORIGIN_PATH=`pwd`
export ORIGIN_PATH
# change to directory with script
PWD=`dirname $0`
cd $PWD
INSTALLER_PWD=`dirname $0`
cd "$INSTALLER_PWD"
if which bash > /dev/null; then
bash helper_scripts/main_install_script.sh "$@"
else
Expand Down
2 changes: 1 addition & 1 deletion version.txt
@@ -1,2 +1,2 @@
Plone version: 5.1.0 (with Zope 2.13.x, Python 2.7.x)
Installer version: Unified Installer 5.1.0
Installer version: Unified Installer 5.1.0-r1

0 comments on commit ac6a7c4

Please sign in to comment.