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 C4BC61382C5 for ; Fri, 22 May 2020 13:20:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C23AEE08C4; Fri, 22 May 2020 13:20:39 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 A7D27E08C4 for ; Fri, 22 May 2020 13:20:39 +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 061C334F2C0 for ; Fri, 22 May 2020 13:20:38 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4B99523E for ; Fri, 22 May 2020 13:20: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: <1590153538.8a4854aec042fc347066a8e73053490c403d7649.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: 8a4854aec042fc347066a8e73053490c403d7649 X-VCS-Branch: master Date: Fri, 22 May 2020 13:20: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: 35842832-97f5-466d-9e7c-4fcff4de9bcc X-Archives-Hash: 76e9d8efc7f642f042e4fdb6a716f921 commit: 8a4854aec042fc347066a8e73053490c403d7649 Author: Sergei Trofimovich gentoo org> AuthorDate: Fri May 22 13:18:58 2020 +0000 Commit: Sergei Trofimovich gentoo org> CommitDate: Fri May 22 13:18:58 2020 +0000 URL: https://gitweb.gentoo.org/proj/gcc-config.git/commit/?id=8a4854ae gcc-config: make USE_NATIVE_LINKS=no to clean stale symlinks Before the change symlinks like /usr/bin/cc were untouched. After the change they are explicitly removed. Bug: https://bugs.gentoo.org/724454 Signed-off-by: Sergei Trofimovich gentoo.org> gcc-config | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/gcc-config b/gcc-config index 847cde2..8f9d64c 100755 --- a/gcc-config +++ b/gcc-config @@ -287,7 +287,7 @@ update_wrappers() { # `tuple-foo`. Only native ones do we want the simple `foo` # and only for USE_NATIVE_LINKS=yes mode. local all_wrappers=( ${new_wrappers[@]/#/${CTARGET}-} ) - if ! is_cross_compiler && [[ ${USE_NATIVE_LINKS} == yes ]] ; then + if ! is_cross_compiler ; then all_wrappers+=( "${new_wrappers[@]}" ) # There are a few fun extra progs which we have to handle #412319 all_wrappers+=( cc:gcc f77:g77 ) @@ -303,12 +303,9 @@ update_wrappers() { # # x=cc:gcc -> ref=/path/to/gcc ref="${ROOT}${GCC_PATH}/${x#*:}" - if [[ ${x} == *:* ]] ; then - # Only install a wrapper if the reference binary exists ... - [[ -x ${ref} ]] || continue - fi # x=cc:gcc -> x=cc x=${x%:*} + if [[ ! -x ${ref} ]] ; then if is_cross_compiler ; then ewarn "insanity with ${x} and ${ref}" @@ -320,10 +317,12 @@ update_wrappers() { fi # Now do the actual linking to the target binary - if [[ -x ${ref} ]] ; then + if [[ ${x#${CTARGET}-} == ${x} && ${USE_NATIVE_LINKS} != yes ]]; then + # Delete stale native symlink. + rm -f "${EROOT}usr/bin/${x}" + elif [[ -x ${ref} ]] ; then atomic_ln "${ref#${ROOT}}" "${EROOT}usr/bin" "${x}" else - ewarn "double insanity with ${x} and ${ref}" # Make sure we have no stale wrappers rm -f "${EROOT}usr/bin/${x}" fi