commit:     9cd3e07fc522120bcfe57353e30d185926da0891
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Feb  6 09:29:30 2016 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Feb  6 09:29:30 2016 +0000
URL:        
https://gitweb.gentoo.org/proj/eselect-python.git/commit/?id=9cd3e07f

show: Fix --pref-only

 python.eselect.in | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/python.eselect.in b/python.eselect.in
index bbe024f..2bf6e30 100644
--- a/python.eselect.in
+++ b/python.eselect.in
@@ -216,14 +216,14 @@ do_show() {
        done
 
        local preferred=( $(get_preferred_pythons ${filter}) )
-       local installed=()
-       if [[ ! ${pref_only} ]]; then
-               installed=( $(get_installed_pythons ${filter}) )
-       fi
+       local installed=( $(get_installed_pythons ${filter}) )
 
+       local all=( "${preferred[@]}" )
        # preferred are preferred, but fall back to anything
+       [[ ${pref_only} ]] || all+=( "${installed[@]}" )
+
        local i
-       for i in "${preferred[@]}" "${installed[@]}"; do
+       for i in "${all[@]}"; do
                # skip if not installed
                has "${i}" "${installed[@]}" || continue
                interpreter=${i}

Reply via email to