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 7900A158015 for ; Sun, 24 Dec 2023 12:31:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CA2282BC022; Sun, 24 Dec 2023 12:31:21 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.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 844562BC015 for ; Sun, 24 Dec 2023 12:31:21 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH] cargo.eclass: Support PKGBUMPING to avoid fetching/unpacking crates Date: Sun, 24 Dec 2023 13:31:15 +0100 Message-ID: <20231224123115.87410-1-mgorny@gentoo.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: aec43d00-a452-4a4c-b356-acf9f9c0d0bc X-Archives-Hash: b33c0b053d4394cd6adb7c6ca694d6dc Support using the PKGBUMPING variable set by pkgbump/pkgdiff-mg to avoid respectively fetching and unpacking crates, to speed up using these tools. Signed-off-by: Michał Górny --- eclass/cargo.eclass | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass index 1e1a6e3ddfe2..b66b7247bd97 100644 --- a/eclass/cargo.eclass +++ b/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 -- 2.43.0