Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/eselect-rust:master commit in: /
Date: Sat, 03 Jul 2021 07:49:40
Message-Id: 1625298536.7ac58a21d2fd6e66852c7ae2e6c09f3b836b73a1.gyakovlev@gentoo
1 commit: 7ac58a21d2fd6e66852c7ae2e6c09f3b836b73a1
2 Author: David Michael <fedora.dm0 <AT> gmail <DOT> com>
3 AuthorDate: Fri May 14 14:16:57 2021 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Sat Jul 3 07:48:56 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/eselect-rust.git/commit/?id=7ac58a21
7
8 Stop using absolute symlinks
9
10 Prefixing everything with ${EROOT} produces invalid paths on the
11 target system. All of the symlinks point to files in the same
12 directory, so there is no reason to specify directories at all.
13
14 Bug: https://bugs.gentoo.org/790305
15 Signed-off-by: David Michael <fedora.dm0 <AT> gmail.com>
16 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
17
18 README.md | 4 ----
19 rust.eselect.in | 8 ++++----
20 2 files changed, 4 insertions(+), 8 deletions(-)
21
22 diff --git a/README.md b/README.md
23 index 6ae99cf..ac3a34d 100644
24 --- a/README.md
25 +++ b/README.md
26 @@ -75,7 +75,3 @@ then `/etc/env.d/rust/provider-TARGET` should contain:
27 ```
28
29 Note, that `/usr/bin/rustc` should not be listed, as it is always managed by eselect.
30 -
31 -### Notes
32 -
33 -**eselect-rust** automatically prepends every path with `${EROOT}` variable.
34
35 diff --git a/rust.eselect.in b/rust.eselect.in
36 index c3ee046..7ab845b 100644
37 --- a/rust.eselect.in
38 +++ b/rust.eselect.in
39 @@ -1,4 +1,4 @@
40 -# Copyright 1999-2020 Gentoo Authors
41 +# Copyright 1999-2021 Gentoo Authors
42 # Distributed under the terms of the GNU General Public License v2
43
44 DESCRIPTION="Manage the Rust compiler versions"
45 @@ -157,7 +157,7 @@ set_symlink() {
46
47 remove_symlink "${dest}"
48
49 - if [[ -e ${source} ]]; then
50 + if [[ -e ${dest%/*}/${source} ]]; then
51 mkdir -p "$(dirname ${dest})" || die -q "directory creation failed for $(dirname ${dest})"
52 ln -s "${source}" "${dest}" || die -q "${dest} symlink setting failed"
53 else
54 @@ -197,11 +197,11 @@ set_version() {
55
56 unset_version
57
58 - set_symlink "${BIN_DIR}/rustc-${target_postfix}" "${BIN_DIR}/rustc"
59 + set_symlink "rustc-${target_postfix}" "${BIN_DIR}/rustc"
60
61 local symlinks=( $(get_symlinks ${target}) )
62 for i in "${symlinks[@]}"; do
63 - set_symlink "${EROOT%/}${i}-${target_postfix}" "${EROOT%/}${i}"
64 + set_symlink "${i##*/}-${target_postfix}" "${EROOT%/}${i}"
65 done
66
67 cp "${ENV_D_PATH}/rust/provider-${target}" \