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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 030631581FB for ; Mon, 2 Dec 2024 08:46:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 60B24E07A5; Mon, 2 Dec 2024 08:46:21 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2092CE079C for ; Mon, 2 Dec 2024 08:46:20 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B2AD033BE1D for ; Mon, 2 Dec 2024 08:46:18 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9672AF96 for ; Mon, 2 Dec 2024 08:46:16 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1733126052.aa28c9e374ad3ef2e647f56ffc97352e7667494d.kangie@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/rust/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-lang/rust/rust-1.71.1-r100.ebuild dev-lang/rust/rust-1.74.1-r100.ebuild dev-lang/rust/rust-1.75.0-r100.ebuild dev-lang/rust/rust-1.77.1-r100.ebuild dev-lang/rust/rust-1.79.0-r100.ebuild dev-lang/rust/rust-1.80.1-r100.ebuild dev-lang/rust/rust-1.81.0-r100.ebuild dev-lang/rust/rust-1.82.0-r100.ebuild X-VCS-Directories: dev-lang/rust/ X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: aa28c9e374ad3ef2e647f56ffc97352e7667494d X-VCS-Branch: master Date: Mon, 2 Dec 2024 08:46:16 +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: 816a239d-dd3d-472e-9d73-9fa7d7caf612 X-Archives-Hash: b169763e5d5ddc877f03d96dd5079c24 commit: aa28c9e374ad3ef2e647f56ffc97352e7667494d Author: Matt Jolly gentoo org> AuthorDate: Mon Dec 2 05:18:43 2024 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Dec 2 07:54:12 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aa28c9e3 dev-lang/rust: update non-slotted rust library tidyup We would previously `die` if there was only one file found matching libraries in ${old_rust_libs} after the fingerprint was stripped. It turns out that it's not uncommon for fingerprints to match, and it is entirely possible for one (or most!) libraries to actually be overridden. Keep the existing duplicate handling but log the `expected 2 but found 1` case just in case we need to track this down. Since all -r100 ebuild are having `pkg_postinst` updated, be consistent about `optfeature` usage. Signed-off-by: Matt Jolly gentoo.org> dev-lang/rust/rust-1.71.1-r100.ebuild | 48 ++++++++++++++++++++++++----------- dev-lang/rust/rust-1.74.1-r100.ebuild | 48 ++++++++++++++++++++++++----------- dev-lang/rust/rust-1.75.0-r100.ebuild | 48 ++++++++++++++++++++++++----------- dev-lang/rust/rust-1.77.1-r100.ebuild | 48 ++++++++++++++++++++++++----------- dev-lang/rust/rust-1.79.0-r100.ebuild | 48 ++++++++++++++++++++++++----------- dev-lang/rust/rust-1.80.1-r100.ebuild | 48 ++++++++++++++++++++++++----------- dev-lang/rust/rust-1.81.0-r100.ebuild | 44 ++++++++++++++++++++++---------- dev-lang/rust/rust-1.82.0-r100.ebuild | 44 ++++++++++++++++++++++---------- 8 files changed, 260 insertions(+), 116 deletions(-) diff --git a/dev-lang/rust/rust-1.71.1-r100.ebuild b/dev-lang/rust/rust-1.71.1-r100.ebuild index 78f8d663cf0d..61b83be8cfe4 100644 --- a/dev-lang/rust/rust-1.71.1-r100.ebuild +++ b/dev-lang/rust/rust-1.71.1-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} @@ -646,20 +646,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 @@ -669,13 +692,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() { diff --git a/dev-lang/rust/rust-1.74.1-r100.ebuild b/dev-lang/rust/rust-1.74.1-r100.ebuild index 7d362a51d3ed..8f20eaf957cb 100644 --- a/dev-lang/rust/rust-1.74.1-r100.ebuild +++ b/dev-lang/rust/rust-1.74.1-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} @@ -676,20 +676,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 @@ -699,13 +722,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() { 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() { diff --git a/dev-lang/rust/rust-1.77.1-r100.ebuild b/dev-lang/rust/rust-1.77.1-r100.ebuild index 2aa9d06c5418..1733f374b32e 100644 --- a/dev-lang/rust/rust-1.77.1-r100.ebuild +++ b/dev-lang/rust/rust-1.77.1-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} @@ -677,20 +677,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 @@ -700,13 +723,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() { diff --git a/dev-lang/rust/rust-1.79.0-r100.ebuild b/dev-lang/rust/rust-1.79.0-r100.ebuild index 392cc8f26840..110d37cfd528 100644 --- a/dev-lang/rust/rust-1.79.0-r100.ebuild +++ b/dev-lang/rust/rust-1.79.0-r100.ebuild @@ -9,8 +9,8 @@ PYTHON_COMPAT=( python3_{10..13} ) 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} @@ -680,20 +680,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 @@ -703,13 +726,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() { diff --git a/dev-lang/rust/rust-1.80.1-r100.ebuild b/dev-lang/rust/rust-1.80.1-r100.ebuild index 72080e2236fe..4d508a08c7fa 100644 --- a/dev-lang/rust/rust-1.80.1-r100.ebuild +++ b/dev-lang/rust/rust-1.80.1-r100.ebuild @@ -9,8 +9,8 @@ PYTHON_COMPAT=( python3_{10..13} ) 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} @@ -677,20 +677,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 @@ -700,13 +723,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() { diff --git a/dev-lang/rust/rust-1.81.0-r100.ebuild b/dev-lang/rust/rust-1.81.0-r100.ebuild index 54695b7209d5..3d79dc11e336 100644 --- a/dev-lang/rust/rust-1.81.0-r100.ebuild +++ b/dev-lang/rust/rust-1.81.0-r100.ebuild @@ -681,20 +681,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 @@ -704,13 +727,8 @@ pkg_postinst() { elog "for convenience they are installed under /usr/bin/rust-{gdb,lldb}-${PV}." fi - if has_version app-editors/emacs; then - optfeature "emacs support for rust" app-emacs/rust-mode - fi - - if has_version app-editors/gvim || has_version app-editors/vim; then - optfeature "vim support for rust" app-vim/rust-vim - fi + optfeature "Emacs support" "app-emacs/rust-mode" + optfeature "Vim support" "app-vim/rust-vim" } pkg_postrm() { diff --git a/dev-lang/rust/rust-1.82.0-r100.ebuild b/dev-lang/rust/rust-1.82.0-r100.ebuild index 714ff39f1a8e..284ed799139a 100644 --- a/dev-lang/rust/rust-1.82.0-r100.ebuild +++ b/dev-lang/rust/rust-1.82.0-r100.ebuild @@ -691,20 +691,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 @@ -714,13 +737,8 @@ pkg_postinst() { elog "for convenience they are installed under /usr/bin/rust-{gdb,lldb}-${PV}." fi - if has_version app-editors/emacs; then - optfeature "emacs support for rust" app-emacs/rust-mode - fi - - if has_version app-editors/gvim || has_version app-editors/vim; then - optfeature "vim support for rust" app-vim/rust-vim - fi + optfeature "Emacs support" "app-emacs/rust-mode" + optfeature "Vim support" "app-vim/rust-vim" } pkg_postrm() {