eclass/cargo: Sync with Gentoo

It's from Gentoo commit 8c2aba680ad0a767829c1133189792081671f54d.
This commit is contained in:
Flatcar Buildbot 2025-04-07 07:07:49 +00:00 committed by Krzesimir Nowak
parent c082fea59e
commit e026a91dc3

View File

@ -603,12 +603,12 @@ cargo_live_src_unpack() {
export CARGO_HOME="${ECARGO_REGISTRY_DIR}"
# Absence of quotes around offline arg is intentional, as cargo bails out if it encounters ''
einfo "cargo fetch ${offline:+--offline}"
cargo fetch ${offline:+--offline} || die #nowarn
einfo "${CARGO} fetch ${offline:+--offline}"
"${CARGO}" fetch ${offline:+--offline} || die #nowarn
# Let cargo copy all required crates to "${WORKDIR}" for offline use in later phases.
einfo "cargo vendor ${offline:+--offline} ${ECARGO_VENDOR}"
cargo vendor ${offline:+--offline} "${ECARGO_VENDOR}" || die #nowarn
einfo "${CARGO} vendor ${offline:+--offline} ${ECARGO_VENDOR}"
"${CARGO}" vendor ${offline:+--offline} "${ECARGO_VENDOR}" || die #nowarn
# Users may have git checkouts made by cargo.
# While cargo vendors the sources, it still needs git checkout to be present.