diff options
author | V3n3RiX <venerix@koprulu.sector> | 2025-04-19 08:46:18 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2025-04-19 08:46:18 +0100 |
commit | 9e65a38a260a44292ceb8a0bf4fea5f0b5666826 (patch) | |
tree | 40c907f5d72cda463e42d2ee5d5434b3790e06df /eclass | |
parent | cf1a411e806b434c96329401a6ff0901ec7f0d5c (diff) |
gentoo auto-resync : 19:04:2025 - 08:46:17edge
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/Manifest.gz | bin | 40338 -> 40342 bytes | |||
-rw-r--r-- | eclass/cargo.eclass | 28 |
2 files changed, 16 insertions, 12 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz Binary files differindex cfa748f98495..015af7cf206b 100644 --- a/eclass/Manifest.gz +++ b/eclass/Manifest.gz diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass index d93ae1723470..428341d568db 100644 --- a/eclass/cargo.eclass +++ b/eclass/cargo.eclass @@ -245,6 +245,16 @@ ECARGO_VENDOR="${ECARGO_HOME}/gentoo" # @DESCRIPTION: # List of URIs to put in SRC_URI created from CRATES variable. +# @FUNCTION: _cargo_check_initialized +# @INTERNAL +# @DESCRIPTION: +# Checks if rust_pkg_setup has been run. +_cargo_check_initialized() { + if [[ -z "${CARGO}" ]]; then + die "CARGO is not set; was rust_pkg_setup run?" + fi +} + # @FUNCTION: _cargo_set_crate_uris # @USAGE: <crates> # @DESCRIPTION: @@ -468,9 +478,7 @@ cargo_target_dir() { cargo_update_crates () { debug-print-function ${FUNCNAME} "$@" - if [[ -z ${CARGO} ]]; then - die "CARGO is not set; was rust_pkg_setup run?" - fi + _cargo_check_initialized local path=${1:-"${S}/Cargo.toml"} if [[ $# -gt 1 ]]; then @@ -553,6 +561,8 @@ cargo_live_src_unpack() { [[ "${PV}" == *9999* ]] || die "${FUNCNAME} only allowed in live/9999 ebuilds" [[ "${EBUILD_PHASE}" == unpack ]] || die "${FUNCNAME} only allowed in src_unpack" + _cargo_check_initialized + mkdir -p "${S}" || die mkdir -p "${ECARGO_VENDOR}" || die mkdir -p "${ECARGO_HOME}" || die @@ -778,9 +788,7 @@ cargo_env() { cargo_src_compile() { debug-print-function ${FUNCNAME} "$@" - if [[ -z "${CARGO}" ]]; then - die "CARGO is not set; was rust_pkg_setup run?" - fi + _cargo_check_initialized set -- "${CARGO}" build $(usex debug "" --release) ${ECARGO_ARGS[@]} "$@" einfo "${@}" @@ -796,9 +804,7 @@ cargo_src_compile() { cargo_src_install() { debug-print-function ${FUNCNAME} "$@" - if [[ -z "${CARGO}" ]]; then - die "CARGO is not set; was rust_pkg_setup run?" - fi + _cargo_check_initialized set -- "${CARGO}" install $(has --path ${@} || echo --path ./) \ --root "${ED}/usr" \ @@ -818,9 +824,7 @@ cargo_src_install() { cargo_src_test() { debug-print-function ${FUNCNAME} "$@" - if [[ -z "${CARGO}" ]]; then - die "CARGO is not set; was rust_pkg_setup run?" - fi + _cargo_check_initialized set -- "${CARGO}" test $(usex debug "" --release) ${ECARGO_ARGS[@]} "$@" einfo "${@}" |