From 9f632996c30645fb0cbb64bbdc2c0002d7d52bfc Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 9 Mar 2016 17:20:24 +0100 Subject: [PATCH] Pmodules/modbuild: - add '--bootsstrap' option and appropriate code adapted - minor changes --- Pmodules/modbuild | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/Pmodules/modbuild b/Pmodules/modbuild index 108d79c..82df8bc 100755 --- a/Pmodules/modbuild +++ b/Pmodules/modbuild @@ -165,13 +165,14 @@ declare -r OS=$(uname -s) # number of parallel make jobs declare -i JOBS=3 -debug_on='no' -force_rebuild='no' -dry_run='no' -enable_cleanup_build='yes' -enable_cleanup_src='no' -target='all' -module_release='' +declare debug_on='no' +declare force_rebuild='no' +declare dry_run='no' +declare enable_cleanup_build='yes' +declare enable_cleanup_src='no' +declare target='all' +declare module_release='' +declare bootstrap='no' # array collecting all modules specified on the command line via '--with=module' with_modules=() @@ -258,6 +259,9 @@ while (( $# > 0 )); do --version= ) V=${1/--version=} ;; + --bootstrap ) + bootstrap='yes' + ;; [0-9]* ) V=$1 ;; @@ -277,19 +281,17 @@ fi [[ -r ${BUILD_BLOCK} ]] || std::die 1 "${BUILD_BLOCK}: no such file!" - # source Pmodule environment configuration -if [[ -r ${BUILD_BLOCK_DIR}/../config/${pmodule_environment} ]]; then - # we are bootstrapping +if [[ "${bootstrap}" == "yes" ]]; then + [[ -r ${BUILD_BLOCK_DIR}/../config/${pmodule_environment} ]] || i\ + std::die 1 "Cannot read configuration file!" source "${BUILD_BLOCK_DIR}/../config/${pmodule_environment}" declare -rx BUILD_BASEDIR=$(std::get_abspath "${BUILD_BLOCK_DIR}/..") - bootstrap='yes' elif [[ -n ${PMODULES_ROOT} ]] && [[ -n ${PMODULES_CONFIG_DIR} ]] && \ [[ -r ${PMODULES_ROOT}/${PMODULES_CONFIG_DIR}/${pmodule_environment} ]]; then source ${PMODULES_ROOT}/${PMODULES_CONFIG_DIR}/${pmodule_environment} declare -rx BUILD_BASEDIR=$(std::get_abspath "${BUILD_BLOCK_DIR}/../..") - bootstrap='no' else std::die 3 "Build environment not setup properbly!"