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 17F9D13933E for ; Sat, 3 Jul 2021 07:49:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 58142E0822; Sat, 3 Jul 2021 07:49:39 +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 1E080E0822 for ; Sat, 3 Jul 2021 07:49:39 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 BFAC6342AF0 for ; Sat, 3 Jul 2021 07:49:37 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 06E3A79A for ; Sat, 3 Jul 2021 07:49:36 +0000 (UTC) From: "Georgy Yakovlev" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Georgy Yakovlev" Message-ID: <1625298536.7ac58a21d2fd6e66852c7ae2e6c09f3b836b73a1.gyakovlev@gentoo> Subject: [gentoo-commits] proj/eselect-rust:master commit in: / X-VCS-Repository: proj/eselect-rust X-VCS-Files: README.md rust.eselect.in X-VCS-Directories: / X-VCS-Committer: gyakovlev X-VCS-Committer-Name: Georgy Yakovlev X-VCS-Revision: 7ac58a21d2fd6e66852c7ae2e6c09f3b836b73a1 X-VCS-Branch: master Date: Sat, 3 Jul 2021 07:49:36 +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: 6e1af181-fea4-46e5-b46d-110fdf4ee79a X-Archives-Hash: d3a50aceddb5211fd52f5ad739295d69 commit: 7ac58a21d2fd6e66852c7ae2e6c09f3b836b73a1 Author: David Michael gmail com> AuthorDate: Fri May 14 14:16:57 2021 +0000 Commit: Georgy Yakovlev gentoo org> CommitDate: Sat Jul 3 07:48:56 2021 +0000 URL: https://gitweb.gentoo.org/proj/eselect-rust.git/commit/?id=7ac58a21 Stop using absolute symlinks Prefixing everything with ${EROOT} produces invalid paths on the target system. All of the symlinks point to files in the same directory, so there is no reason to specify directories at all. Bug: https://bugs.gentoo.org/790305 Signed-off-by: David Michael gmail.com> Signed-off-by: Georgy Yakovlev gentoo.org> README.md | 4 ---- rust.eselect.in | 8 ++++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6ae99cf..ac3a34d 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,3 @@ then `/etc/env.d/rust/provider-TARGET` should contain: ``` Note, that `/usr/bin/rustc` should not be listed, as it is always managed by eselect. - -### Notes - -**eselect-rust** automatically prepends every path with `${EROOT}` variable. diff --git a/rust.eselect.in b/rust.eselect.in index c3ee046..7ab845b 100644 --- a/rust.eselect.in +++ b/rust.eselect.in @@ -1,4 +1,4 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 DESCRIPTION="Manage the Rust compiler versions" @@ -157,7 +157,7 @@ set_symlink() { remove_symlink "${dest}" - if [[ -e ${source} ]]; then + if [[ -e ${dest%/*}/${source} ]]; then mkdir -p "$(dirname ${dest})" || die -q "directory creation failed for $(dirname ${dest})" ln -s "${source}" "${dest}" || die -q "${dest} symlink setting failed" else @@ -197,11 +197,11 @@ set_version() { unset_version - set_symlink "${BIN_DIR}/rustc-${target_postfix}" "${BIN_DIR}/rustc" + set_symlink "rustc-${target_postfix}" "${BIN_DIR}/rustc" local symlinks=( $(get_symlinks ${target}) ) for i in "${symlinks[@]}"; do - set_symlink "${EROOT%/}${i}-${target_postfix}" "${EROOT%/}${i}" + set_symlink "${i##*/}-${target_postfix}" "${EROOT%/}${i}" done cp "${ENV_D_PATH}/rust/provider-${target}" \