[Python-checkins] r52238 - python/trunk/Mac/BuildScript/scripts/postflight.patch-profile
ronald.oussoren
python-checkins at python.org
Sun Oct 8 20:18:26 CEST 2006
Author: ronald.oussoren
Date: Sun Oct 8 20:18:26 2006
New Revision: 52238
Modified:
python/trunk/Mac/BuildScript/scripts/postflight.patch-profile
Log:
MacOSX: add more logic to recognize the correct startup file to patch to the
shell profile patching post-install script.
Modified: python/trunk/Mac/BuildScript/scripts/postflight.patch-profile
==============================================================================
--- python/trunk/Mac/BuildScript/scripts/postflight.patch-profile (original)
+++ python/trunk/Mac/BuildScript/scripts/postflight.patch-profile Sun Oct 8 20:18:26 2006
@@ -47,22 +47,29 @@
echo "${PYTHON_ROOT}/bin is not on your PATH or at least not early enough"
case "${BSH}" in
*csh)
+ if [ -f "${HOME}/.tcshrc" ]; then
+ RC="${HOME}/.tcshrc"
+ else
+ RC="${HOME}/.cshrc"
+ fi
# Create backup copy before patching
- if [ -f "${HOME}/.cshrc" ]; then
- cp -fp "${HOME}/.cshrc" "${HOME}/.cshrc.pysave"
+ if [ -f "${RC}" ]; then
+ cp -fp "${RC}" "${RC}.pysave"
fi
- echo "" >> "${HOME}/.cshrc"
- echo "# Setting PATH for MacPython ${PYVER}" >> "${HOME}/.cshrc"
- echo "# The orginal version is saved in .cshrc.pysave" >> "${HOME}/.cshrc"
- echo "set path=(${PYTHON_ROOT}/bin "'$path'")" >> "${HOME}/.cshrc"
+ echo "" >> "${RC}"
+ echo "# Setting PATH for MacPython ${PYVER}" >> "${RC}"
+ echo "# The orginal version is saved in .cshrc.pysave" >> "${RC}"
+ echo "set path=(${PYTHON_ROOT}/bin "'$path'")" >> "${RC}"
if [ `id -ur` = 0 ]; then
- chown "${USER}" "${HOME}/.cshrc"
+ chown "${USER}" "${RC}"
fi
exit 0
;;
bash)
if [ -e "${HOME}/.bash_profile" ]; then
PR="${HOME}/.bash_profile"
+ elif [ -e "${HOME}/.bash_login" ]; then
+ PR="${HOME}/.bash_login"
elif [ -e "${HOME}/.profile" ]; then
PR="${HOME}/.profile"
else
More information about the Python-checkins
mailing list