commit:     4e9362688c95ac02bafc014a16bbfd399b86ca8c
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 26 13:23:54 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sun Jan 26 13:23:54 2020 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-config.git/commit/?id=4e936268

gcc-config: fix numbered access to toolchains

In commit bc80e12ab1 ("gcc-config: add basic version sorting support")
i've missed the case of accessing toolchain by number:

    $ gcc-config -L 1

The change adds version sorting to numbered access as well.

Reported-by: lekto <AT> o2.pl
Bug: https://bugs.gentoo.org/706318
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 gcc-config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc-config b/gcc-config
index 1ab646b..8b4fd20 100755
--- a/gcc-config
+++ b/gcc-config
@@ -1015,7 +1015,7 @@ for x in "$@" ; do
                        if [[ -z $(echo ${x} | tr -d '[:digit:]') ]] ; then
                                # User gave us a # representing the profile
                                i=1
-                               for y in "${GCC_ENV_D}"/* ; do
+                               for y in $(version_sorted_paths 
"${GCC_ENV_D}"/*) ; do
                                        [[ -f ${y} ]] || continue
                                        [[ ${y} == */config* ]] && continue
 

Reply via email to