From cdd2ce0da44c1c51de9ca762fce8fc0ec571d1cc Mon Sep 17 00:00:00 2001 From: Dominik Honnef Date: Sat, 30 Aug 2014 00:29:33 +0200 Subject: [PATCH] add helpers for working with options Add the helpers vopt_if, vopt_with and vopt_enable that simplify common option-based operations. Instead of a bunch of if [ "$build_option_foo" ]; then configure_args+=" --with-foo" makedepends+=" foo-devel" else configure_args+=" --without-foo" fi one can use configure_args="... $(vopt_with foo) makedepends="... $(vopt_if foo foo-devel)" instead. We're adding these functions to common/xbps-src/shutils/common.sh but that might not be the ideal place. I would've preferred common/helpers/options.sh, but helpers are only available in the individual phases, not when the template itself gets parsed. --- Manual.md | 29 ++++++++++++++++++++++------- common/xbps-src/shutils/common.sh | 21 +++++++++++++++++++++ 2 files changed, 43 insertions(+), 7 deletions(-) diff --git a/Manual.md b/Manual.md index 9ea8dfbf891..4d8a5b884fb 100644 --- a/Manual.md +++ b/Manual.md @@ -514,7 +514,26 @@ should be added to `common/options.description` instead. After defining those required variables, you can check for the `build_option_