[Python-checkins] bpo-29076: Add fish support to macOS installer (GH-23302) (GH-23938)

ned-deily webhook-mailer at python.org
Thu Jan 28 09:55:06 EST 2021


https://github.com/python/cpython/commit/81b23a9b148b60f8f541e4b06e1d88c58644e3b8
commit: 81b23a9b148b60f8f541e4b06e1d88c58644e3b8
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: ned-deily <nad at python.org>
date: 2021-01-28T09:54:57-05:00
summary:

bpo-29076: Add fish support to macOS installer (GH-23302) (GH-23938)

(cherry picked from commit 7f162e867c674f57c308a87fffcdcca3540c8933)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland at innova.no>

files:
A Misc/NEWS.d/next/Build/2020-02-28-14-33-15.bpo-29076.Gtixi5.rst
M Mac/BuildScript/scripts/postflight.patch-profile

diff --git a/Mac/BuildScript/scripts/postflight.patch-profile b/Mac/BuildScript/scripts/postflight.patch-profile
index 0a62e327f51b3..68b8e4bb044e1 100755
--- a/Mac/BuildScript/scripts/postflight.patch-profile
+++ b/Mac/BuildScript/scripts/postflight.patch-profile
@@ -20,7 +20,7 @@ fi
 # Make sure the directory ${PYTHON_ROOT}/bin is on the users PATH.
 BSH="`basename "${theShell}"`"
 case "${BSH}" in
-bash|ksh|sh|*csh|zsh)
+bash|ksh|sh|*csh|zsh|fish)
 	if [ `id -ur` = 0 ]; then
 		P=`su - ${USER} -c 'echo A-X-4-X@@$PATH@@X-4-X-A' | grep 'A-X-4-X@@.*@@X-4-X-A' | sed -e 's/^A-X-4-X@@//g' -e 's/@@X-4-X-A$//g'`
 	else
@@ -76,6 +76,22 @@ bash)
 		PR="${HOME}/.bash_profile"
 	fi
 	;;
+fish)
+	CONFIG_DIR="${HOME}/.config/fish"
+	RC="${CONFIG_DIR}/config.fish"
+	mkdir -p "$CONFIG_DIR"
+	if [ -f "${RC}" ]; then
+		cp -fp "${RC}" "${RC}.pysave"
+	fi
+	echo "" >> "${RC}"
+	echo "# Setting PATH for Python ${PYVER}" >> "${RC}"
+	echo "# The original version is saved in ${RC}.pysave" >> "${RC}"
+	echo "set -x PATH \"${PYTHON_ROOT}/bin\" \"\$PATH\"" >> "${RC}"
+	if [ `id -ur` = 0 ]; then
+		chown "${USER}" "${RC}"
+	fi
+	exit 0
+	;;
 zsh)
         PR="${HOME}/.zprofile"
         ;;
diff --git a/Misc/NEWS.d/next/Build/2020-02-28-14-33-15.bpo-29076.Gtixi5.rst b/Misc/NEWS.d/next/Build/2020-02-28-14-33-15.bpo-29076.Gtixi5.rst
new file mode 100644
index 0000000000000..b38beb0586951
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2020-02-28-14-33-15.bpo-29076.Gtixi5.rst
@@ -0,0 +1 @@
+Add fish shell support to macOS installer.



More information about the Python-checkins mailing list