summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2023-12-24 13:25:39 +0100
committerMichał Górny <mgorny@gentoo.org>2024-01-05 11:54:19 +0100
commit92001837418f3a50e6571c0f533520b42f90d488 (patch)
tree52c8c8b0a713ab09b9b8ea74e7c68ea68a8ff356 /eclass/cargo.eclass
parentnet-analyzer/netdata-go-plugin: new package, add 0.58.0 (diff)
downloadgentoo-92001837418f3a50e6571c0f533520b42f90d488.tar.gz
gentoo-92001837418f3a50e6571c0f533520b42f90d488.tar.bz2
gentoo-92001837418f3a50e6571c0f533520b42f90d488.zip
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 <mgorny@gentoo.org>
Diffstat (limited to 'eclass/cargo.eclass')
-rw-r--r--eclass/cargo.eclass8
1 files changed, 7 insertions, 1 deletions
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