commit:     a1768659e4bd697a2d45e8342e8c122380905e7a
Author:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 27 02:22:27 2019 +0000
Commit:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Sat Dec 28 04:59:10 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a1768659

cargo.eclass: make cargo verbosity configurable

Users can set CARGO_TERM_VERBOSE=false in make.conf if less build output is 
desired.
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>

 eclass/cargo.eclass | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index f26495fc19c..d0288ed2edc 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -125,7 +125,14 @@ cargo_live_src_unpack() {
 
 # @FUNCTION: cargo_gen_config
 # @DESCRIPTION:
-# Generate the $CARGO_HOME/config necessary to use our local registry
+# 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} "$@"
 
@@ -142,6 +149,9 @@ cargo_gen_config() {
 
        [build]
        jobs = $(makeopts_jobs)
+
+       [term]
+       verbose = true
        EOF
 }
 
@@ -153,7 +163,7 @@ cargo_src_compile() {
 
        export CARGO_HOME="${ECARGO_HOME}"
 
-       cargo build -vv $(usex debug "" --release) "$@" \
+       cargo build $(usex debug "" --release) "$@" \
                || die "cargo build failed"
 }
 
@@ -163,7 +173,7 @@ cargo_src_compile() {
 cargo_src_install() {
        debug-print-function ${FUNCNAME} "$@"
 
-       cargo install -vv --path ${CARGO_INSTALL_PATH} \
+       cargo install --path ${CARGO_INSTALL_PATH} \
                --root="${ED}/usr" $(usex debug --debug "") "$@" \
                || die "cargo install failed"
        rm -f "${ED}/usr/.crates.toml"
@@ -177,7 +187,7 @@ cargo_src_install() {
 cargo_src_test() {
        debug-print-function ${FUNCNAME} "$@"
 
-       cargo test -vv $(usex debug "" --release) "$@" \
+       cargo test $(usex debug "" --release) "$@" \
                || die "cargo test failed"
 }
 

Reply via email to