From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C29FF1382C5 for ; Fri, 26 Feb 2021 09:36:38 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E55FAE0882; Fri, 26 Feb 2021 09:36:37 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CE83FE0882 for ; Fri, 26 Feb 2021 09:36:37 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BDD26341032 for ; Fri, 26 Feb 2021 09:36:36 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6AB03531 for ; Fri, 26 Feb 2021 09:36:35 +0000 (UTC) From: "Sergei Trofimovich" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sergei Trofimovich" Message-ID: <1614332092.3efd8ef43c07a53663d8a1f53f1c13ffb0447b87.slyfox@gentoo> Subject: [gentoo-commits] proj/gcc-config:master commit in: / X-VCS-Repository: proj/gcc-config X-VCS-Files: gcc-config X-VCS-Directories: / X-VCS-Committer: slyfox X-VCS-Committer-Name: Sergei Trofimovich X-VCS-Revision: 3efd8ef43c07a53663d8a1f53f1c13ffb0447b87 X-VCS-Branch: master Date: Fri, 26 Feb 2021 09:36:35 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: c0237f18-1098-4a2e-97ce-f74bbaaca921 X-Archives-Hash: de88c7bda743b2b982f74dcaf05fdd1a commit: 3efd8ef43c07a53663d8a1f53f1c13ffb0447b87 Author: Sergei Trofimovich gentoo org> AuthorDate: Fri Feb 26 09:34:52 2021 +0000 Commit: Sergei Trofimovich gentoo org> CommitDate: Fri Feb 26 09:34:52 2021 +0000 URL: https://gitweb.gentoo.org/proj/gcc-config.git/commit/?id=3efd8ef4 gcc-config: add support for special 'latest' version for profile switch To ease switching to latest version add special 'latest' verison. Works for both "latest" and "-latest" forms. Bug: https://bugs.gentoo.org/765664 Signed-off-by: Sergei Trofimovich gentoo.org> gcc-config | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gcc-config b/gcc-config index e8e3d58..6b2a1a7 100755 --- a/gcc-config +++ b/gcc-config @@ -65,6 +65,8 @@ usage() { Profile names are of the form: - (like 'i686-pc-linux-gnu-3.2.1') (like '3.2.1') (as specified in '--list-profiles') + latest + -latest (like mmix-latest) EOF exit ${1:-1} } @@ -1081,6 +1083,14 @@ for x in "$@" ; do die "Could not locate profile #$x !" fi else + # User gave us "latest" or "-latest". + if [[ ${x} == latest ]]; then + get_chost + x=$(version_sorted_paths "${GCC_ENV_D}"/${CHOST}-* | tail -1) + elif [[ ${x} == *-latest ]]; then + x=$(version_sorted_paths "${GCC_ENV_D}"/${x%-latest}-* | tail -1) + fi + # User gave us a full , or x=${x##*/} if [[ ${DOIT} == "get_current_profile" && -z $(ls "${GCC_ENV_D}"/${x}-* 2>/dev/null) ]] || \