diff options
Diffstat (limited to 'app-admin/eselect-python/files/python-eselect.patch')
-rw-r--r-- | app-admin/eselect-python/files/python-eselect.patch | 59 |
1 files changed, 32 insertions, 27 deletions
diff --git a/app-admin/eselect-python/files/python-eselect.patch b/app-admin/eselect-python/files/python-eselect.patch index 2ab8984..58e72d8 100644 --- a/app-admin/eselect-python/files/python-eselect.patch +++ b/app-admin/eselect-python/files/python-eselect.patch @@ -1,6 +1,12 @@ diff -ur eselect-python-20111108.orig/python.eselect eselect-python-20111108/python.eselect ---- eselect-python-20111108.orig/python.eselect 2011-11-09 07:15:22.000000000 +0800 -+++ eselect-python-20111108/python.eselect 2012-06-02 17:50:04.149917271 +0800 +--- python.eselect 2011-11-09 07:15:22.000000000 +0800 ++++ python.eselect 2012-06-06 16:42:14.825413552 +0800 +@@ -1,4 +1,4 @@ +-# Copyright 1999-2010 Gentoo Foundation ++7# Copyright 1999-2010 Gentoo Foundation + # Distributed under the terms of the GNU General Public License v2 + # $Id: $ + @@ -15,9 +15,11 @@ # Find a list of Python versions @@ -151,7 +157,7 @@ diff -ur eselect-python-20111108.orig/python.eselect eselect-python-20111108/pyt else echo -n "${interpreter}" fi -@@ -229,14 +258,25 @@ +@@ -229,14 +258,23 @@ } describe_list_options() { @@ -165,8 +171,6 @@ diff -ur eselect-python-20111108.orig/python.eselect eselect-python-20111108/pyt + local active i python_descriptive_name="Python" python_version_option= python2="0" python3="0" + local pypy1="0" targets=() active_version=$(do_show) + -+ [[ ${1:0:2} == '--' ]] -+ while [[ $# > 0 ]]; do case "$1" in + --pypy1) @@ -178,7 +182,7 @@ diff -ur eselect-python-20111108.orig/python.eselect eselect-python-20111108/pyt --python2) python2="1" python_descriptive_name="Python 2" -@@ -258,19 +298,65 @@ +@@ -258,19 +296,66 @@ if [[ "${python2}" == "1" && "${python3}" == "1" ]]; then die -q "'--python2' and '--python3' options cannot be specified simultaneously" @@ -191,7 +195,7 @@ diff -ur eselect-python-20111108.orig/python.eselect eselect-python-20111108/pyt - targets=($(find_targets)) + combined_targets=($(find_targets)) + # $(find_targets) captures pypy entries; need to filter them from the list -+ if [[ $PYTHON_INTERPRETERS_GROUP != "1" ]]; then ++ if [[ $PYTHON_INTERPRETERS_GROUP > "1" ]]; then + for (( j=0 ; j < ${#combined_targets[@]} ; j++ )) + do + if [[ ${combined_targets[$j]:0:4} == "pypy" ]]; then @@ -199,8 +203,18 @@ diff -ur eselect-python-20111108.orig/python.eselect eselect-python-20111108/pyt + fi + targets[$j]="${combined_targets[$j]}" + done -+ + +- write_list_start "Available ${python_descriptive_name} interpreters:" + +- active="$(do_show ${python_version_option})" +- for ((i = 0; i < ${#targets[@]}; i++)); do +- if [[ ${targets[${i}]} == ${active} ]]; then +- targets[${i}]="$(highlight_marker "${targets[${i}]}")" +- fi +- done +- write_numbered_list -m "(none found)" "${targets[@]}" + write_list_start "Available ${python_descriptive_name} interpreters:" ++ + active="$(do_show ${python_version_option})" + for ((i = 0; i < ${#targets[@]}; i++)); do + if [[ ${targets[${i}]} == ${active} ]]; then @@ -219,8 +233,7 @@ diff -ur eselect-python-20111108.orig/python.eselect eselect-python-20111108/pyt + targets[$j]="${combined_targets[$j]}" + done + write_list_start "Available ${python_descriptive_name} interpreters:" - -- write_list_start "Available ${python_descriptive_name} interpreters:" ++ + if [[ "${active_version:0:4}" == "pypy" ]]; then + active="$(do_show ${python_version_option})" + for ((i = 0; i < ${#targets[@]}; i++)); do @@ -230,19 +243,11 @@ diff -ur eselect-python-20111108.orig/python.eselect eselect-python-20111108/pyt + done + fi + write_numbered_list -m "(none found)" "${targets[@]}" - -- active="$(do_show ${python_version_option})" -- for ((i = 0; i < ${#targets[@]}; i++)); do -- if [[ ${targets[${i}]} == ${active} ]]; then -- targets[${i}]="$(highlight_marker "${targets[${i}]}")" -- fi -- done -- write_numbered_list -m "(none found)" "${targets[@]}" ++ + else + targets=($(find_targets)) -+ write_list_start "Available ${python_descriptive_name} interpreters:" + active="$(do_show ${python_version_option})" -+ ++ write_list_start "Available ${python_descriptive_name} interpreters:" + for ((i = 0; i < ${#targets[@]}; i++)); do + if [[ ${targets[${i}]} == ${active} ]]; then + targets[${i}]="$(highlight_marker "${targets[${i}]}")" @@ -253,7 +258,7 @@ diff -ur eselect-python-20111108.orig/python.eselect eselect-python-20111108/pyt } ### set action ### -@@ -280,6 +366,7 @@ +@@ -280,6 +365,7 @@ } describe_set_options() { @@ -261,7 +266,7 @@ diff -ur eselect-python-20111108.orig/python.eselect eselect-python-20111108/pyt echo "--python2 : Set active Python 2 interpreter without setting of main active Python interpreter if it is not set to Python 2" echo "--python3 : Set active Python 3 interpreter without setting of main active Python interpreter if it is not set to Python 3" } -@@ -289,10 +376,14 @@ +@@ -289,10 +375,14 @@ } do_set() { @@ -277,7 +282,7 @@ diff -ur eselect-python-20111108.orig/python.eselect eselect-python-20111108/pyt --python2) python2="1" PYTHON_INTERPRETERS_GROUP="2" -@@ -310,6 +401,10 @@ +@@ -310,6 +400,10 @@ if [[ "${python2}" == "1" && "${python3}" == "1" ]]; then die -q "'--python2' and '--python3' options cannot be specified simultaneously" @@ -288,7 +293,7 @@ diff -ur eselect-python-20111108.orig/python.eselect eselect-python-20111108/pyt fi if [[ $# -lt 1 ]]; then -@@ -319,9 +414,11 @@ +@@ -319,9 +413,11 @@ else main_active_python_interpreter="$(do_show)" if [[ "${python2}" == "1" && "${main_active_python_interpreter}" != "python2."* ]]; then @@ -303,7 +308,7 @@ diff -ur eselect-python-20111108.orig/python.eselect eselect-python-20111108/pyt fi if ! set_scripts_and_symlinks "${1}"; then -@@ -343,12 +440,14 @@ +@@ -343,12 +439,14 @@ describe_update_options() { echo "--if-unset : Do not override existing implementation" echo "--ignore SLOT : Ignore SLOT when setting symlinks" @@ -319,7 +324,7 @@ diff -ur eselect-python-20111108.orig/python.eselect eselect-python-20111108/pyt while [[ $# > 0 ]]; do case "$1" in --if-unset) -@@ -357,6 +456,10 @@ +@@ -357,6 +455,10 @@ --ignore) ignored_slots+=("${2}") shift;; @@ -330,7 +335,7 @@ diff -ur eselect-python-20111108.orig/python.eselect eselect-python-20111108/pyt --python2) python2="1" python_version_option="--python2" -@@ -374,19 +477,28 @@ +@@ -374,19 +476,28 @@ if [[ "${python2}" == "1" && "${python3}" == "1" ]]; then die -q "'--python2' and '--python3' options cannot be specified simultaneously" |