commit:     e6337fe78b77a17b23d7e7db46af7bec32f1c126
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 19 01:06:45 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sun Apr 19 01:12:26 2020 +0000
URL:        https://gitweb.gentoo.org/proj/eselect-rust.git/commit/?id=e6337fe7

find_missing_broken_symlinks(): add symlinks for new targets

This commit will ensure that we will create a new symlink
which didn't exist before for a new target, i.e. after
re-installing a rust provider with changed USE flags.

Bug: https://bugs.gentoo.org/688864
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 rust.eselect.in | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/rust.eselect.in b/rust.eselect.in
index 9de7149..1b33280 100644
--- a/rust.eselect.in
+++ b/rust.eselect.in
@@ -18,6 +18,16 @@ find_missing_broken_symlinks() {
        local -a missing_symlinks
        local required_symlinks=( "/usr/bin/rustc" $(get_last_set_symlinks) )
 
+       local target=$(get_current_target)
+       if [ "${target}" != "NOT_SET" ]; then
+               # make sure we add new symlinks for new targets,
+               # i.e. after changed USE flags
+               required_symlinks+=( $(get_symlinks ${target}) )
+       fi
+
+       required_symlinks=( $(printf "%s\n" "${required_symlinks[@]}" | sort 
-u) )
+
+       local i
        for i in "${required_symlinks[@]}"; do
                local symlink="${EROOT%/}${i}"
 

Reply via email to