From 8decc17f3efad71b51eda9e1558d563988305ded Mon Sep 17 00:00:00 2001 From: William Ting Date: Wed, 11 Apr 2012 23:03:03 -1000 Subject: [PATCH] Update documentation and install scripts to reflect new minimum Python requirements. Documentation and install scripts now instruct older Python users to upgrade their Python version or install older versions of autojump. 'install.sh' now gets a -f|--force option, which makes the install ignore Python dependency requirements. --- INSTALL.md | 6 ++++++ README.md | 11 +++++++++++ install.sh | 49 +++++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 58 insertions(+), 8 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 5dc1012..16fda4a 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -6,6 +6,12 @@ Python v2.7+ or 3.2+ Bash v4.0+ for tab completion +If you are unable to update Python to a supported version, older versions of autojump can be [downloaded](https://github.com/joelthelion/autojump/downloads) and installed manually. + +Python v2.6+ is supported by [release v19](https://github.com/downloads/joelthelion/autojump/autojump_v19.tar.gz). + +Python v2.4+ is supported by [release v12](https://github.com/downloads/joelthelion/autojump/autojump_v12.tar.gz). + ### AUTOMATIC INSTALLATION **Linux** diff --git a/README.md b/README.md index f322894..fe76b53 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,17 @@ Python v2.7+ or 3.2+ Bash v4.0+ for tab completion +If you are unable to update Python to a supported version, older +versions of autojump can be +[downloaded](https://github.com/joelthelion/autojump/downloads) and +installed manually. + +Python v2.6+ is supported by [release +v19](https://github.com/downloads/joelthelion/autojump/autojump_v19.tar.gz). + +Python v2.4+ is supported by [release +v12](https://github.com/downloads/joelthelion/autojump/autojump_v12.tar.gz). + ### AUTOMATIC INSTALLATION **Linux** diff --git a/install.sh b/install.sh index 1c28c3e..88d72eb 100755 --- a/install.sh +++ b/install.sh @@ -47,6 +47,7 @@ function help_msg { # Default install directory. shell=`echo ${SHELL} | awk -F/ '{ print $NF }'` +force= if [[ ${UID} -eq 0 ]]; then local= prefix=/usr @@ -72,6 +73,10 @@ while true; do shell="bash" shift ;; + -f|--force) + force=true + shift + ;; -g|--global) local= shift @@ -127,18 +132,46 @@ if [[ ${shell} != "bash" ]] && [[ ${shell} != "zsh" ]]; then fi # check Python version -python_version=`python -c 'import sys; print(sys.version_info[:])'` -if [[ ${python_version:1:1} -eq 2 && ${python_version:4:1} -lt 7 ]]; then - echo - echo "Incompatible Python version, please upgrade to v2.7+ or v3.2+." - if [[ ${python_version:4:1} -gt 3 ]]; then +if [ ! ${force} ]; then + python_version=`python -c 'import sys; print(sys.version_info[:])'` + + if [[ ${python_version:1:1} -eq 3 && ${python_version:4:1} -lt 2 ]]; then echo - echo "Alternatively, you can download v12 that supports Python v2.4+ from:" + echo "Incompatible Python version, please upgrade to v2.7+ or v3.2+." echo - echo -e "\thttps://github.com/joelthelion/autojump/tags" + echo "Alternatively, you can download v19 that supports Python v3.0+ from:" echo + echo -e "\thttps://github.com/joelthelion/autojump/downloads" + echo + echo "OR" + echo + echo "Install argparse manually using 'pip install argparse' and then reattempt the installation using the --force option." + echo + exit 1 + fi + + if [[ ${python_version:1:1} -eq 2 && ${python_version:4:1} -lt 7 ]]; then + echo + echo "Incompatible Python version, please upgrade to v2.7+ or v3.2+." + if [[ ${python_version:4:1} -ge 6 ]]; then + echo + echo "Alternatively, you can download v19 that supports Python v2.6+ from:" + echo + echo -e "\thttps://github.com/joelthelion/autojump/downloads" + echo + echo "OR" + echo + echo "Install argparse manually using 'pip install argparse' and then reattempt the installation using the --force option." + echo + elif [[ ${python_version:4:1} -ge 4 ]]; then + echo + echo "Alternatively, you can download v12 that supports Python v2.4+ from:" + echo + echo -e "\thttps://github.com/joelthelion/autojump/downloads" + echo + fi + exit 1 fi - exit 1 fi echo