diff options
author | Michał Górny <mgorny@gentoo.org> | 2024-01-30 17:40:23 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2024-01-31 14:59:19 +0100 |
commit | 541088baec1ffcb943426333891a88c8935c64a6 (patch) | |
tree | de683c094b0049deb5be390fda0e046da72603e8 /eclass/cargo.eclass | |
parent | virtual/rust: Drop old versions (diff) | |
download | gentoo-541088baec1ffcb943426333891a88c8935c64a6.tar.gz gentoo-541088baec1ffcb943426333891a88c8935c64a6.tar.bz2 gentoo-541088baec1ffcb943426333891a88c8935c64a6.zip |
cargo.eclass: Output only the first crate URI when PKGBUMPING
Modify cargo_set_crate_uris to output only the first crate URI when
PKGBUMPING is set for the current ebuild. This makes pkgdiff-mg much
faster on Rust packages, as it does not have to fetch all the hundreds
of crates that aren't part of the diff anyway. This is an improved
version of 92001837418f3a50e6571c0f533520b42f90d488, as the original
attempted not to output any URIs, and therefore could create empty
groups in SRC_URI that are invalid.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/35097
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/cargo.eclass')
-rw-r--r-- | eclass/cargo.eclass | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass index 3bdbb5e3ec64..0f2da982f60c 100644 --- a/eclass/cargo.eclass +++ b/eclass/cargo.eclass @@ -193,6 +193,11 @@ _cargo_set_crate_uris() { fi url="https://crates.io/api/v1/crates/${name}/${version}/download -> ${name}-${version}.crate" CARGO_CRATE_URIS+="${url} " + + # when invoked by pkgbump, avoid fetching all the crates + # we just output the first one, to avoid creating empty groups + # in SRC_URI + [[ ${PKGBUMPING} == ${PVR} ]] && return done if declare -p GIT_CRATES &>/dev/null; then |