commit: aa28c9e374ad3ef2e647f56ffc97352e7667494d
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 2 05:18:43 2024 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> 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 <kangie <AT> 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() {