Merge pull request #801 from yyuu/let-jython-to-generate-launcher-as-shell-script

Let Jython installer to generate shell script instead of python script even if there's `python2.7` available in `$PATH`
This commit is contained in:
Yamashita, Yuu 2017-01-06 23:26:44 +09:00 committed by GitHub
commit 4d96271113
6 changed files with 19 additions and 4 deletions

View file

@ -588,7 +588,7 @@ fetch_jar() {
# Must use full path to jar and destination directory:
# http://bugs.jython.org/issue2350
{ if $JAVA -jar $PWD/${package_name}.jar -s -d $PWD/${package_name}; then
{ if $JAVA -jar "$PWD/${package_name}.jar" -s -d "$PWD/${package_name}"; then
if [ -z "$KEEP_BUILD_PATH" ]; then
rm -f "$package_filename"
else
@ -902,11 +902,10 @@ fix_jython_shebangs() {
for file in "${PREFIX_PATH}/bin"/*; do
case "$(head -1 "${file}")" in
"#!"*"/bin/jython" )
sed -i.bak "1 s:.*:#\!\/usr\/bin\/env ${PREFIX_PATH}\/bin\/jython:" "${file}"
sed -i.bak "1 s:.*:#\!${PREFIX_PATH}\/bin\/jython:" "${file}"
;;
"#!"*"/bin/python2.7"* )
# Jython 2.7+ requires CPython 2.7 to run
sed -i.bak "1 s:.*:#\!\/usr\/bin\/env python2.7:" "${file}"
sed -i.bak "1 s:.*:#\!\/usr\/bin\/env python:" "${file}"
;;
esac
rm -f "${file}.bak"
@ -1276,6 +1275,17 @@ require_java() {
export JAVA="$java"
}
# Let Jython installer to generate shell script instead of python script even if there's `python2.7` available in `$PATH` (#800)
# FIXME: better function naming
unrequire_python27() {
export PATH="${BUILD_PATH}/bin:${PATH}"
mkdir -p "${BUILD_PATH}/bin"
if command -v python2.7 1>/dev/null 2>&1; then
echo false > "${BUILD_PATH}/bin/python2.7"
chmod +x "${BUILD_PATH}/bin/python2.7"
fi
}
require_distro() {
for arg; do
if [[ "$(cat /etc/issue 2>/dev/null || true)" == "$arg"* ]]; then

View file

@ -1,4 +1,5 @@
require_java
unrequire_python27
install_jar "jython-2.7.0" "https://repo1.maven.org/maven2/org/python/jython-installer/2.7.0/jython-installer-2.7.0.jar#b44352ece72382268a60e2848741c96609a91d796bb9a9c6ebeff62f0c12c9cf" jython
case "$(pypy_architecture 2>/dev/null || true)" in

View file

@ -1,4 +1,5 @@
require_java
unrequire_python27
install_jar "jython-2.7.1b1" "https://repo1.maven.org/maven2/org/python/jython-installer/2.7.1b1/jython-installer-2.7.1b1.jar#c7a05911fed666c8f9df5bdce50bb5dc75482b7f6b1f1dbe433162d94c960ec3" jython
case "$(pypy_architecture 2>/dev/null || true)" in

View file

@ -1,4 +1,5 @@
require_java
unrequire_python27
install_jar "jython-2.7.1b2" "https://repo1.maven.org/maven2/org/python/jython-installer/2.7.1b2/jython-installer-2.7.1b2.jar#d994500808c8d448baab1f98e043e6a11360cff302f401901e73f0e34c27251a" jython
case "$(pypy_architecture 2>/dev/null || true)" in

View file

@ -1,4 +1,5 @@
require_java
unrequire_python27
install_jar "jython-2.7.1b3" "https://repo1.maven.org/maven2/org/python/jython-installer/2.7.1b3/jython-installer-2.7.1b3.jar#5c6c7dc372a131dbc2b29b95407c69a4ebab22c1823d9098b7f993444f3090c5" jython
case "$(pypy_architecture 2>/dev/null || true)" in

View file

@ -1,4 +1,5 @@
require_java
unrequire_python27
install_hg "jython-dev" "https://hg.python.org/jython" "default" jython_builder ez_setup
# pip (>= 1.3) does not work properly since it uses HTTPS for downloads
# * https://github.com/yyuu/pyenv/issues/15