Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 30906 Details for
Bug 41508
Zope-2.7.0 is the latest STABLE release
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
changes to zope-config to get zope-2.7.0+ to work.
zope-config.patch (text/plain), 9.85 KB, created by
Carter Smithhart
on 2004-05-07 00:25:42 UTC
(
hide
)
Description:
changes to zope-config to get zope-2.7.0+ to work.
Filename:
MIME Type:
Creator:
Carter Smithhart
Created:
2004-05-07 00:25:42 UTC
Size:
9.85 KB
patch
obsolete
>--- zope-config.original 2004-05-06 18:21:50.133922416 -0700 >+++ /usr/sbin/zope-config 2004-05-07 00:13:34.873464936 -0700 >@@ -5,12 +5,18 @@ > # Originally written by Jason Shoemaker <kutsuya@gentoo.org> > # Portions by solution2u.net gmbh (Logging and some cleanups) > # Portions by Robin Johnson <robbat2@gentoo.org> (Documentation and further cleanup) >+# Portions by Carter Smithhart <derheld42@derheld.net> (2.7.0 stuff) > # > # Copyright 1999-2003 Gentoo Technologies, Inc. > # Distributed under the terms of the GNU General Public License v2 > # $Header: /home/cvsroot/gentoo-x86/app-admin/zope-config/files/0.3/zope-config,v 1.2 2003/12/12 07:40:57 lanius Exp $ >- >-VERSION="0.2" >+# >+# >+# Notes: >+# $ZI_DIR/.default holds name of default zope instance >+# $NEWZOPE is set to 1 if the zope server is 2.7.0 or newer >+# >+VERSION="0.3" > > CONFIGFILE=/etc/zope-config.conf > if [ -e ${CONFIGFILE} ]; then >@@ -24,9 +30,7 @@ > E_SUCCESS=0 > E_FAILURE=1 > >-#E_ZPLIST=20 > E_ZILIST=22 >-#E_COMMAND=24 > E_PARAM=26 > E_ZSLIST=28 > E_ZIDEFAULT=30 >@@ -34,7 +38,6 @@ > #Parameters: > # $1 = instance directory > # $2 = group >- > zinst_security_setup() > { > chown -R ${ZUID}:${2} ${1} >@@ -44,18 +47,68 @@ > chmod +t ${1}/var/ > } > >+# params: $ZSERV_DIR >+# returns 1 if $ZSERV_DIR is a 2.7 or newer Zope. Also sets NEWZOPE to 1. >+zserv_is_2.7_or_newer() >+{ >+ TEXT=$(echo $1 | grep ${ZS_DIR2}) >+ if [ "$TEXT" = "" ] ; then >+ NEWZOPE=0 >+ return 0; >+ fi >+ NEWZOPE=1 >+ return 1; >+} >+ > #Params: > # $1 = zserv dir > # $2 = zinst dir >- > zinst_fs_setup() > { > local RESULT=${E_FAILURE} >+ local USER= >+ local PASS= >+ local PASS2= > > if [ "${#}" -lt 2 ] ; then > # need a param > RESULT=${E_PARAM} > else >+ if [ $NEWZOPE = 1 ] ; then >+ while : ; do >+ USER=$(dialog --stdout \ >+ --backtitle "Please choose a username and password for the initial user." \ >+ --inputbox "Username:" 0 0 "admin") >+ RESULT=$? >+ if [ "$USER" != "" ] ; then >+ break >+ fi >+ done >+ while : ; do >+ PASS=$(dialog --stdout \ >+ --backtitle "Please choose a username and password for the initial user." \ >+ --passwordbox "Password:" 0 0 "") >+ RESULT=$? >+ if [ "$PASS" = "" ] ; then >+ continue >+ fi >+ PASS2=$(dialog --stdout \ >+ --backtitle "Please choose a username and password for the initial user." \ >+ --passwordbox "Reenter Password:" 0 0 "") >+ RESULT=$? >+ if [ "$PASS2" = "" ] ; then >+ continue >+ fi >+ if [ $PASS = $PASS2 ] ; then >+ break >+ else >+ dialog --msgbox "Passwords must be equal!" 0 0 >+ fi >+ done >+ su zope -c "$1/bin/mkzopeinstance.py --dir $2 --user $USER:$PASS" >+ RESULT=${E_SUCCESS} >+ else >+ # prior to 2.7 > mkdir -p $2 || exit 1 > if [ $(zinst_default_get >/dev/null)$? -ne 0 ] ; then > echo $(basename ${ZINST_DIR}) >${ZI_DIR}/.default >@@ -77,6 +130,7 @@ > fi > > RESULT=$? >+ fi > fi > > return ${RESULT} >@@ -86,7 +140,6 @@ > # $1 = zserv dir > # $2 = zinst dir > # $3 = zinst name >- > zinst_rc_setup() > { > local RESULT=${E_FAILURE} >@@ -95,6 +148,14 @@ > # need a param > RESULT=${E_PARAM} > else >+ if [ $NEWZOPE = 1 ] ; then >+ install $1/.templates/zope.initd ${INITD}/${3} >+ sed -i \ >+ -e "s|ZINST_DIR=|ZINST_DIR=${2}|" \ >+ -e "s|EVENT_LOG_FILE=|EVENT_LOG_FILE=${EVENTLOGDIR}\/${3}|" \ >+ ${INITD}/${3} >+ RESULT=${E_SUCCESS} >+ else > install $1/.templates/zope.confd ${CONFD}/${3} > install $1/.templates/zope.initd ${INITD}/${3} > sed -i \ >@@ -103,21 +164,22 @@ > -e "/EVENT_LOG_FILE=/ c\\EVENT_LOG_FILE=${EVENTLOGDIR}\/${3}\\ " \ > ${CONFD}/${3} > RESULT=$? >- # make sure the directory exists >- mkdir -p ${EVENTLOGDIR} >/dev/null 2>&1 >+ fi >+ # make sure the directory exists >+ mkdir -p ${EVENTLOGDIR} >/dev/null 2>&1 > fi > return ${RESULT} > } > >-# >- >+# Sets the variable: ZSERV_DIR and returns 0 >+# or returns a non-zero error code > zserv_dir_get() > { > local RESULT=${E_FAILURE} >- local LIST=$(ls ${ZS_DIR}) >+ local LIST=$(ls -d ${ZS_DIR}* ; ls -d ${ZS_DIR2}*) > local LIST_CNT=$(echo ${LIST} | wc -w) > local DLIST= >- >+ > # Assume that LIST_TMP contains valid zserver dirs. > if [ ${LIST_CNT} -eq 1 ] ; then > ZSERV_DIR=${LIST} >@@ -128,17 +190,20 @@ > done > ZSERV_DIR=$(dialog --stdout \ > --title "Zope Server List" \ >- --menu "Select desired zserver: " 0 0 ${LIST_CNT} ${DLIST}) >+ --menu "Select desired zserver: " 0 40 ${LIST_CNT} ${DLIST}) > RESULT=$? > else > RESULT=${E_ZSLIST} # There are no zservers > fi >- ZSERV_DIR="${ZS_DIR}${ZSERV_DIR}" >+ >+ # set NEWZOPE to 1 if we are dealing with a "newer" zope version >+ zserv_is_2.7_or_newer ${ZERV_DIR} >+ > return ${RESULT} > } > >-# >- >+# Sets the variable: ZINST_DIR and returns 0 >+# or returns a non-zero error code > zinst_dir_set() > { > local RESULT= >@@ -152,9 +217,9 @@ > --backtitle "Need a uniqe name for zinstance directory.(Also the name of the rcscript.)" \ > --inputbox "Enter a new zinstance name:" 0 0 ${DEFAULT_ZINSTANCENAME} ) > RESULT=$? >- if [ ${RESULT} -ne 0 ] ; then >- break >- elif [ -z ${ZINST_DIR} ] ; then >+ if [ ${RESULT} -ne 0 ] ; then >+ break >+ elif [ -z ${ZINST_DIR} ] ; then > dialog --msgbox "Error: need a name." 0 0 > continue > elif echo ${ZINST_DIR} |grep "/" ; then >@@ -162,7 +227,7 @@ > continue > elif [[ -d "${ZI_DIR}${ZINST_DIR}" && \ > -f "${INITD}/${ZINST_DIR}" ]] ; then >- dialog --msgbox "Error: ${ZINST_DIR} zinstance already exists." 0 0 >+ dialog --msgbox "Error: ${ZINST_DIR} zinstance already exists. Delete ${INITD}/${ZINST_DIR} to replace instance." 0 0 > continue > fi > ZINST_DIR=${ZI_DIR}${ZINST_DIR} >@@ -171,8 +236,8 @@ > return ${RESULT} > } > >-# >- >+# sets the variable $ZINST_DIR and returns 0 >+# or returns non-null error code > zinst_dir_get() > { > local RESULT=1 >@@ -199,13 +264,14 @@ > return ${RESULT} > } > >-# >- >+# makes ZSERV_DIR the default zope version. if ZSERV_DIR > zinst_default_set() > { > local RESULT= > >- zinst_dir_get >+ if [ -z ${ZINST_DIR} ] ; then >+ zinst_dir_get || { echo 'Canceled: zinst_dir_get' ; exit 1 ; } >+ fi > RESULT=$? > if [ ${RESULT} -eq 0 ] ; then > echo $(basename ${ZINST_DIR}) >${ZI_DIR}/.default >@@ -216,7 +282,6 @@ > } > > # Echos the default directory that this instance was created in >- > zinst_default_get() > { > local RESULT=${E_ZIDEFAULT} >@@ -230,7 +295,6 @@ > > # Gets a name for the group that owns the new zinstance and also creates the > # group if nessicary >- > zinst_zgid_set() > { > local RESULT= >@@ -256,7 +320,6 @@ > } > > # Sets the inituser password for a given zinstance >- > zinst_zpasswd_set() > { > if [ -z ${ZSERV_DIR} ] ; then >@@ -266,10 +329,18 @@ > zinst_dir_get || exit $? > fi > >- echo ">>> Create Zope inituser for \"$(basename ${ZINST_DIR})\"..." >- /usr/bin/python ${ZSERV_DIR}/zpasswd.py ${ZINST_DIR}/inituser >- # If zpasswd is aborted it creates a blank inituser >- chown ${ZUID} ${ZINST_DIR}/inituser >+ zserv_is_2.7_or_newer ${ZSERV_DIR} >+ if [ $NEWZOPE = 1 ] ; then >+ echo ">>> Create Zope inituser for \"$(basename ${ZINST_DIR})\"..." >+ /usr/bin/python ${ZSERV_DIR}/bin/zpasswd.py ${ZINST_DIR}/inituser >+ # If zpasswd is aborted it creates a blank inituser >+ chown ${ZUID} ${ZINST_DIR}/inituser >+ else >+ echo ">>> Create Zope inituser for \"$(basename ${ZINST_DIR})\"..." >+ /usr/bin/python ${ZSERV_DIR}/zpasswd.py ${ZINST_DIR}/inituser >+ # If zpasswd is aborted it creates a blank inituser >+ chown ${ZUID} ${ZINST_DIR}/inituser >+ fi > } > > # help! >@@ -285,7 +356,7 @@ > echo -e "\t$(basename $0) --[zserv=[dir] &| zinst=[dir] &| zgid=[name]]" > echo "Non-interactive usage:" > echo -e "\t$(basename $0) --[zidef-get | zidef-set | zpasswd | version | help]" >- echo -e "\t$(basename $0) --[zserv=[dir] & zinst=[dir] & zgid=[name]]" >+ echo -e "\t$(basename $0) --[zserv=[dir] & zinst=[di] & zgid=[name]]" > exit ${E_SUCCESS} > } > >@@ -311,19 +382,23 @@ > shift > done > >+# if ZSERV_DIR isn't set by command line, call zserv_dir_get to set it > if [ -z ${ZSERV_DIR} ] ; then > zserv_dir_get || { echo 'Canceled: zserv_dir_get' ; exit 1 ; } > fi > >+# if ZINST_DIR passed by command line, call zinst_dir_set to set it > if [ -z ${ZINST_DIR} ] ; then > zinst_dir_set || { echo 'Canceled: zinst_dir_set' ; exit 1 ; } > fi > >+# if ZIRC_NAME isn't set then use the base of the ZINST_DIR for ZIRC_NAME > [ -z ${ZIRC_NAME} ] && ZIRC_NAME=$(basename ${ZINST_DIR}) > > if [ -z ${ZGID_NAME} ] ; then > zinst_zgid_set || { echo 'Canceled: zinst_zgid_set' ; exit 1 ; } > fi >+zserv_is_2.7_or_newer ${ZSERV_DIR} > > zinst_fs_setup ${ZSERV_DIR} ${ZINST_DIR} > zinst_rc_setup ${ZSERV_DIR} ${ZINST_DIR} ${ZIRC_NAME} >@@ -332,9 +407,12 @@ > # add existing user zope to the new group > gpasswd -a zope ${ZGID_NAME} > >-zinst_security_setup ${ZINST_DIR} ${ZGID_NAME} >- > # TODO: see about adding interactive configuration of ZOPE_OPTS >-echo "Note: Don\'t forget to edit ZOPE_OPTS in ${CONFD}${ZIRC_NAME}" >-echo " (you might want to add -P 8{1,2,3,..}00 to set the zope ports offset)" >+if [ $NEWZOPE != 1 ] ; then >+ zinst_security_setup ${ZINST_DIR} ${ZGID_NAME} >+ >+ echo "Note: Don't forget to edit ZOPE_OPTS in ${CONFD}${ZIRC_NAME}" >+ echo " (you might want to add -P 8{1,2,3,..}00 to set the zope ports offset)" >+fi >+ >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 41508
:
28323
|
30905
| 30906 |
30907
|
30909
|
30910
|
33521
|
33950
|
33951
|
33952
|
34055
|
34059
|
34078
|
35340
|
35399
|
35770
|
35771
|
35865