commit: d8168ac771d03175117fe453a1c0f93612a1eb38
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 29 01:57:55 2020 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Tue Sep 29 02:00:46 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8168ac7
eclass/cargo.eclass: move cargo_gen_config definition to the top
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
eclass/cargo.eclass | 76 ++++++++++++++++++++++++++---------------------------
1 file changed, 38 insertions(+), 38 deletions(-)
diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index bbb3d40a620..e6fec844d27 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -91,6 +91,44 @@ cargo_crate_uris() {
done
}
+# @FUNCTION: cargo_gen_config
+# @DESCRIPTION:
+# Generate the $CARGO_HOME/config necessary to use our local registry and
settings.
+# Cargo can also be configured through environment variables in addition to
the TOML syntax below.
+# For each configuration key below of the form foo.bar the environment
variable CARGO_FOO_BAR
+# can also be used to define the value.
+# Environment variables will take precedent over TOML configuration,
+# and currently only integer, boolean, and string keys are supported.
+# For example the build.jobs key can also be defined by CARGO_BUILD_JOBS.
+# Or setting CARGO_TERM_VERBOSE=false in make.conf will make build quieter.
+cargo_gen_config() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ mkdir -p "${ECARGO_HOME}" || die
+
+ cat > "${ECARGO_HOME}/config" <<- _EOF_ || die "Failed to create cargo
config"
+ [source.gentoo]
+ directory = "${ECARGO_VENDOR}"
+
+ [source.crates-io]
+ replace-with = "gentoo"
+ local-registry = "/nonexistant"
+
+ [net]
+ offline = true
+
+ [build]
+ jobs = $(makeopts_jobs)
+
+ [term]
+ verbose = true
+ $([[ "${NOCOLOR}" = true || "${NOCOLOR}" = yes ]] && echo "color =
'never'")
+ _EOF_
+
+ export CARGO_HOME="${ECARGO_HOME}"
+ _CARGO_GEN_CONFIG_HAS_RUN=1
+}
+
# @FUNCTION: cargo_src_unpack
# @DESCRIPTION:
# Unpacks the package and the cargo registry
@@ -230,44 +268,6 @@ cargo_live_src_unpack() {
cargo_gen_config
}
-# @FUNCTION: cargo_gen_config
-# @DESCRIPTION:
-# Generate the $CARGO_HOME/config necessary to use our local registry and
settings.
-# Cargo can also be configured through environment variables in addition to
the TOML syntax below.
-# For each configuration key below of the form foo.bar the environment
variable CARGO_FOO_BAR
-# can also be used to define the value.
-# Environment variables will take precedent over TOML configuration,
-# and currently only integer, boolean, and string keys are supported.
-# For example the build.jobs key can also be defined by CARGO_BUILD_JOBS.
-# Or setting CARGO_TERM_VERBOSE=false in make.conf will make build quieter.
-cargo_gen_config() {
- debug-print-function ${FUNCNAME} "$@"
-
- mkdir -p "${ECARGO_HOME}" || die
-
- cat > "${ECARGO_HOME}/config" <<- _EOF_ || die "Failed to create cargo
config"
- [source.gentoo]
- directory = "${ECARGO_VENDOR}"
-
- [source.crates-io]
- replace-with = "gentoo"
- local-registry = "/nonexistant"
-
- [net]
- offline = true
-
- [build]
- jobs = $(makeopts_jobs)
-
- [term]
- verbose = true
- $([[ "${NOCOLOR}" = true || "${NOCOLOR}" = yes ]] && echo "color =
'never'")
- _EOF_
-
- export CARGO_HOME="${ECARGO_HOME}"
- _CARGO_GEN_CONFIG_HAS_RUN=1
-}
-
# @FUNCTION: cargo_src_configure
# @DESCRIPTION:
# Configure cargo package features and arguments.