From 1d4b3de94ce7ffb4739fd13cb64f6f23c2d04342 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 17 May 2017 10:33:35 +0200 Subject: [PATCH] Pmodules/libpbuild - search_variante_file(): set 'variants_file' to empty string if none found - load_build_dependencies(): * here we don't have to look for a variants file any more * bugfix in testing prefix 'b:' and 'r:' for build- or runtime dependency --- Pmodules/libpbuild.bash | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/Pmodules/libpbuild.bash b/Pmodules/libpbuild.bash index d9cb43a..7fb7d4c 100644 --- a/Pmodules/libpbuild.bash +++ b/Pmodules/libpbuild.bash @@ -274,12 +274,14 @@ search_variants_file() { eligible_variants_files+=( "${V%.*}/variants" ) eligible_variants_files+=( "${V%.*.*}/variants.${OS}" ) eligible_variants_files+=( "${V%.*.*}/variants" ) + for variants_file in "${eligible_variants_files[@]}"; do if [[ -e "${BUILD_BLOCK_DIR}/${variants_file}" ]]; then variants_file="${BUILD_BLOCK_DIR}/${variants_file}" return 0 fi done + variants_file='' return 1 } @@ -478,24 +480,8 @@ pbuild::make_all() { # depend_release set if a dependency is 'unstable' or 'deprecated' # load_build_dependencies() { - local -a eligible_variants_files=() - eligible_variants_files+=( "${V}/variants.${OS}" ) - eligible_variants_files+=( "${V}/variants" ) - eligible_variants_files+=( "${V%.*}/variants.${OS}" ) - eligible_variants_files+=( "${V%.*}/variants" ) - eligible_variants_files+=( "${V%.*.*}/variants.${OS}" ) - eligible_variants_files+=( "${V%.*.*}/variants" ) - local found='no' - local variants_file='' - for variants_file in "${eligible_variants_files[@]}"; do - if [[ -e "${BUILD_BLOCK_DIR}/${variants_file}" ]]; then - found='yes' - variants_file="${BUILD_BLOCK_DIR}/${variants_file}" - break - fi - done local m - if [[ "${found}" == "yes" ]]; then + if [[ -n "${variants_file}" ]]; then # :FIXME: # handle conflicts in modules specified via command-line # argument and variants file @@ -520,9 +506,9 @@ pbuild::make_all() { # 'b:' this is a build dependency # 'r:' this a run-time dependency, *not* required for building # without prefix: this is a build and run-time dependency - if [[ $m =~ b:* ]]; then + if [[ "${m:0:2}" == "b:" ]]; then m=${m#*:} # remove 'b:' - elif [[ $m =~ r:* ]]; then + elif [[ "${m:0:2}" == "r:" ]]; then m=${m#*:} # remove 'r:' runtime_dependencies+=( "$m" ) else