diff options
Diffstat (limited to 'dev-lang/rust/rust-1.75.0-r100.ebuild')
| -rw-r--r-- | dev-lang/rust/rust-1.75.0-r100.ebuild | 48 |
1 files changed, 33 insertions, 15 deletions
diff --git a/dev-lang/rust/rust-1.75.0-r100.ebuild b/dev-lang/rust/rust-1.75.0-r100.ebuild index 6a5b34dda65a..e3beb23ab729 100644 --- a/dev-lang/rust/rust-1.75.0-r100.ebuild +++ b/dev-lang/rust/rust-1.75.0-r100.ebuild @@ -9,8 +9,8 @@ PYTHON_COMPAT=( python3_{10..12} ) RUST_MAX_VER=${PV} RUST_MIN_VER="$(ver_cut 1).$(($(ver_cut 2) - 1)).0" -inherit check-reqs estack flag-o-matic llvm-r1 multiprocessing \ - multilib multilib-build python-any-r1 rust rust-toolchain toolchain-funcs verify-sig +inherit check-reqs estack flag-o-matic llvm-r1 multiprocessing multilib multilib-build \ + optfeature python-any-r1 rust rust-toolchain toolchain-funcs verify-sig if [[ ${PV} = *beta* ]]; then betaver=${PV//*beta} @@ -678,20 +678,43 @@ pkg_preinst() { pkg_postinst() { - if has_version -b "dev-lang/rust:stable/$(ver_cut 1-2)"; then + local old_rust="dev-lang/rust:stable/$(ver_cut 1-2)" + if has_version -b ${old_rust}; then # Be _extra_ careful here as we're removing files from the live filesystem local f + local only_one_file=() + einfo "Tidying up libraries files from non-slotted \`${old_rust}\`." for f in "${old_rust_libs[@]}"; do [[ -f ${f} ]] || die "old_rust_libs array contains non-existent file" local base_name="${f%-*}" local ext="${f##*.}" local matching_files=("${base_name}"-*.${ext}) - if [[ ${#matching_files[@]} -ne 2 ]]; then - die "Expected exactly two files matching ${base_name}-\*.rlib, but found ${#matching_files[@]}" - fi - einfo "Removing old .rlib file ${f}" - rm "${f}" || die + case ${#matching_files[@]} in + 2) + einfo "Removing old .${ext}: ${f}" + rm "${f}" || die + ;; + 1) + # Turns out fingerprints are not as unique as we'd thought, _sometimes_ they collide, + # so we may have already installed over the old file. + # We'll warn about this just in case, but it's probably fine. + only_one_file+=( "${matching_files[0]}" ) + ;; + *) + die "Expected one or two files matching ${base_name}-\*.rlib, but found ${#matching_files[@]}" + ;; + esac done + if [[ ${#only_one_file} -gt 0 ]]; then + einfo "While tidying up non-slotted rust libraries for \`${old_rust}\`," + einfo "the following file(s) did not have a duplicate where one was expected:" + for f in "${only_one_file[@]}"; do + einfo " * ${f}" + done + einfo "" + einfo "This is unlikely to cause problems; the fingerprint for the library ended up being the same." + einfo "However, if you encounter any issues please report them to the Gentoo Rust Team." + fi fi eselect rust update @@ -701,13 +724,8 @@ pkg_postinst() { elog "for convenience they are installed under /usr/bin/rust-{gdb,lldb}-${PV}." fi - if has_version app-editors/emacs; then - elog "install app-emacs/rust-mode to get emacs support for rust." - fi - - if has_version app-editors/gvim || has_version app-editors/vim; then - elog "install app-vim/rust-vim to get vim support for rust." - fi + optfeature "Emacs support" "app-emacs/rust-mode" + optfeature "Vim support" "app-vim/rust-vim" } pkg_postrm() { |
