commit:     43d792963272d90d48c9794d58233e2d7a1ee83c
Author:     orbea <orbea <AT> riseup <DOT> net>
AuthorDate: Fri Feb 21 16:45:00 2025 +0000
Commit:     orbea <orbea <AT> riseup <DOT> net>
CommitDate: Fri Feb 21 16:45:00 2025 +0000
URL:        https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=43d79296

dev-lang/rust: drop rehash-crate.sh

Signed-off-by: orbea <orbea <AT> riseup.net>

 dev-lang/rust/files/rehash-crate.sh   | 18 ------------------
 dev-lang/rust/rust-1.71.1-r101.ebuild | 11 +++++------
 2 files changed, 5 insertions(+), 24 deletions(-)

diff --git a/dev-lang/rust/files/rehash-crate.sh 
b/dev-lang/rust/files/rehash-crate.sh
deleted file mode 100644
index c43f542..0000000
--- a/dev-lang/rust/files/rehash-crate.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-# $1 = crate patch file
-
-set -euf
-
-cargo='.cargo-checksum.json'
-
-grep -- '^[+][+][+] ' "${1:?}" | while read -r _ f; do
-       file="${f#*/}"
-       orig_sum="$(grep -Eo "\"${file}\":\"[0-9a-fA-F]+\"" "${cargo}" |
-               cut -d':' -f2 | tr -d '"')"
-       if [ -n "${orig_sum}" ]; then
-               sum="$(sha256sum "${file}")"
-               sed -i "s|${orig_sum}|${sum%% *}|" "${cargo}"
-       fi
-done
-
-exit 0

diff --git a/dev-lang/rust/rust-1.71.1-r101.ebuild 
b/dev-lang/rust/rust-1.71.1-r101.ebuild
index bbeede3..2c737e6 100644
--- a/dev-lang/rust/rust-1.71.1-r101.ebuild
+++ b/dev-lang/rust/rust-1.71.1-r101.ebuild
@@ -146,11 +146,10 @@ PATCHES=(
 )
 
 eapply_crate() {
-       pushd "${1:?}" > /dev/null || die
-       local patch="${2:?}"
-       eapply "${patch}"
-       "${EPREFIX}"/bin/sh "${FILESDIR}"/rehash-crate.sh "${patch}" || die
+       pushd "vendor/${1:?}" > /dev/null || die
+       eapply "${2:?}"
        popd > /dev/null || die
+       sed -i 's/\("files":{\)[^}]*/\1/' "vendor/${1}/.cargo-checksum.json" || 
die
 }
 
 toml_usex() {
@@ -222,8 +221,8 @@ pkg_setup() {
 }
 
 src_prepare() {
-       eapply_crate vendor/openssl-sys-0.9.85 
"${FILESDIR}"/1.71.0-libressl-openssl-sys.patch
-       eapply_crate vendor/openssl-sys 
"${FILESDIR}"/1.71.0-libressl-openssl-sys.patch
+       eapply_crate openssl-sys-0.9.85 
"${FILESDIR}"/1.71.0-libressl-openssl-sys.patch
+       eapply_crate openssl-sys "${FILESDIR}"/1.71.0-libressl-openssl-sys.patch
        default
 }
 

Reply via email to