commit:     321a4cf17c0e4c5829b3a2d4582472a920fc9189
Author:     Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Sun Feb  9 01:15:14 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Feb 10 00:16:35 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=321a4cf1

dev-lang/rust: drop preinst/postinst workaround for 1.84.{0,1}

This workaround is only required when migrating from non-slotted
Rust to slotted Rust. Since these versions have never had
a non-slotted counterpart, this step is superfluous.

Remove it now in conjunction with an unrelated revbump so that
the workaround isn't carried forward any further.

Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-lang/rust/rust-1.84.0-r1.ebuild | 36 ------------------------------------
 dev-lang/rust/rust-1.84.1-r1.ebuild | 36 ------------------------------------
 2 files changed, 72 deletions(-)

diff --git a/dev-lang/rust/rust-1.84.0-r1.ebuild 
b/dev-lang/rust/rust-1.84.0-r1.ebuild
index 3fbaeec5c488..10294bcfad06 100644
--- a/dev-lang/rust/rust-1.84.0-r1.ebuild
+++ b/dev-lang/rust/rust-1.84.0-r1.ebuild
@@ -681,44 +681,8 @@ src_install() {
        fi
 }
 
-pkg_preinst() {
-       # 943308 and friends; basically --keep-going can forget to unmerge old 
rust
-       # but the soft blocker allows us to install conflicting files.
-       # This results in duplicated .{rlib,so} files which confuses rustc and 
results in
-       # the need for manual intervention.
-       if has_version -b "dev-lang/rust:stable/$(ver_cut 1-2)"; then
-               # we need to find all .{rlib,so} files in the old rust lib 
directory
-               # and store them in an array for later use
-               readarray -d '' old_rust_libs < <(
-                       find "${EROOT}/usr/lib/rust/${PV}/lib/rustlib" \
-                       -type f \( -name '*.rlib' -o -name '*.so' \) -print0)
-               export old_rust_libs
-               if [[ ${#old_rust_libs[@]} -gt 0 ]]; then
-                       einfo "Found old .rlib and .so files in the old rust 
lib directory"
-               else
-                       die "Found no old .rlib and .so files but old rust 
version is installed. Bailing!"
-               fi
-       fi
-}
-
 pkg_postinst() {
 
-       if has_version -b "dev-lang/rust:stable/$(ver_cut 1-2)"; then
-               # Be _extra_ careful here as we're removing files from the live 
filesystem
-               local f
-               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
-               done
-       fi
-
        eselect rust update
 
        if has_version dev-debug/gdb || has_version llvm-core/lldb; then

diff --git a/dev-lang/rust/rust-1.84.1-r1.ebuild 
b/dev-lang/rust/rust-1.84.1-r1.ebuild
index 605506b91c5a..8ae682155bcc 100644
--- a/dev-lang/rust/rust-1.84.1-r1.ebuild
+++ b/dev-lang/rust/rust-1.84.1-r1.ebuild
@@ -681,44 +681,8 @@ src_install() {
        fi
 }
 
-pkg_preinst() {
-       # 943308 and friends; basically --keep-going can forget to unmerge old 
rust
-       # but the soft blocker allows us to install conflicting files.
-       # This results in duplicated .{rlib,so} files which confuses rustc and 
results in
-       # the need for manual intervention.
-       if has_version -b "dev-lang/rust:stable/$(ver_cut 1-2)"; then
-               # we need to find all .{rlib,so} files in the old rust lib 
directory
-               # and store them in an array for later use
-               readarray -d '' old_rust_libs < <(
-                       find "${EROOT}/usr/lib/rust/${PV}/lib/rustlib" \
-                       -type f \( -name '*.rlib' -o -name '*.so' \) -print0)
-               export old_rust_libs
-               if [[ ${#old_rust_libs[@]} -gt 0 ]]; then
-                       einfo "Found old .rlib and .so files in the old rust 
lib directory"
-               else
-                       die "Found no old .rlib and .so files but old rust 
version is installed. Bailing!"
-               fi
-       fi
-}
-
 pkg_postinst() {
 
-       if has_version -b "dev-lang/rust:stable/$(ver_cut 1-2)"; then
-               # Be _extra_ careful here as we're removing files from the live 
filesystem
-               local f
-               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
-               done
-       fi
-
        eselect rust update
 
        if has_version dev-debug/gdb || has_version llvm-core/lldb; then

Reply via email to