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 (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4B37315803E for ; Fri, 5 Jan 2024 10:54:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 93D242BC152; Fri, 5 Jan 2024 10:54:24 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 pigeon.gentoo.org (Postfix) with ESMTPS id 77F212BC152 for ; Fri, 5 Jan 2024 10:54:24 +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)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 921363430EC for ; Fri, 5 Jan 2024 10:54:23 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 301DB1300 for ; Fri, 5 Jan 2024 10:54:22 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1704452059.92001837418f3a50e6571c0f533520b42f90d488.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/cargo.eclass X-VCS-Directories: eclass/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 92001837418f3a50e6571c0f533520b42f90d488 X-VCS-Branch: master Date: Fri, 5 Jan 2024 10:54:22 +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: 34e83159-9824-47d0-af11-645280919e69 X-Archives-Hash: 5f92d817b5dd96583f74cda6f6265628 commit: 92001837418f3a50e6571c0f533520b42f90d488 Author: Michał Górny gentoo org> AuthorDate: Sun Dec 24 12:25:39 2023 +0000 Commit: Michał Górny gentoo org> CommitDate: Fri Jan 5 10:54:19 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=92001837 cargo.eclass: Support PKGBUMPING to avoid fetching/unpacking crates Support using the PKGBUMPING variable set by pkgbump/pkgdiff-mg to avoid respectively fetching and unpacking crates, to speed up using these tools. Closes: https://github.com/gentoo/gentoo/pull/34459 Signed-off-by: Michał Górny gentoo.org> eclass/cargo.eclass | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass index 1e1a6e3ddfe2..7bdd548b0df8 100644 --- a/eclass/cargo.eclass +++ b/eclass/cargo.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2023 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: cargo.eclass @@ -175,6 +175,9 @@ ECARGO_VENDOR="${ECARGO_HOME}/gentoo" # If no arguments are provided, it uses the CRATES variable. # The value is set as CARGO_CRATE_URIS. _cargo_set_crate_uris() { + # when called by pkgbump, do not fetch crates + [[ ${PKGBUMPING} == ${PVR} ]] && return + local -r regex='^([a-zA-Z0-9_\-]+)-([0-9]+\.[0-9]+\.[0-9]+.*)$' local crates=${1} local crate @@ -331,6 +334,9 @@ cargo_src_unpack() { for archive in ${A}; do case "${archive}" in *.crate) + # when called by pkgdiff-mg, do not unpack crates + [[ ${PKGBUMPING} == ${PVR} ]] && continue + ebegin "Loading ${archive} into Cargo registry" tar -xf "${DISTDIR}"/${archive} -C "${ECARGO_VENDOR}/" || die # generate sha256sum of the crate itself as cargo needs this