From 2601c606a2ce38af55fbb86de2a528a436c02913 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 30 Sep 2015 17:06:51 +0200 Subject: [PATCH] Pmodules/modbuild - fix bug in handling --release option --- Bootstrap/Pmodules/libpbuild.bash | 11 ++++++++++- Bootstrap/Pmodules/modbuild | 8 +++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Bootstrap/Pmodules/libpbuild.bash b/Bootstrap/Pmodules/libpbuild.bash index 7d3814d..e3a3c81 100644 --- a/Bootstrap/Pmodules/libpbuild.bash +++ b/Bootstrap/Pmodules/libpbuild.bash @@ -26,6 +26,15 @@ declare -x LIBRARY_PATH declare -x LD_LIBRARY_PATH declare -x DYLD_LIBRARY_PATH +is_release() { + [[ :${releases}: =~ :$1: ]] && return 0 + std::die 1 "${P}: '$1' is not a valid release name." +} + +pbuild::set_release() { + is_release "$1" && MODULE_RELEASE="$1" +} + ############################################################################## # # set supported OS @@ -36,7 +45,7 @@ pbuild::supported_os() { for os in "$@"; do [[ ${os} == ${OS} ]] && return 0 done - std::die 0 "${P}: Not available for ${OS}." + std::die 1 "${P}: Not available for ${OS}." } ############################################################################## diff --git a/Bootstrap/Pmodules/modbuild b/Bootstrap/Pmodules/modbuild index 385d229..a8db72d 100755 --- a/Bootstrap/Pmodules/modbuild +++ b/Bootstrap/Pmodules/modbuild @@ -176,8 +176,8 @@ force_rebuild='no' dry_run='no' enable_cleanup_build='yes' enable_cleanup_src='no' - target='all' +module_release='' # array collecting all modules specified on the command line via '--with=module' with_modules=() @@ -224,7 +224,7 @@ while (( $# > 0 )); do dry_run='yes' ;; --release=* ) - MODULE_RELEASE=${1/--release=} + module_release=${1/--release=} ;; --with=*/* ) with_modules+=( ${1/--with=} ) @@ -328,13 +328,15 @@ _P=$(echo $P | tr [:lower:] [:upper:]) _P=${_P//-/_} _V=${_P}_VERSION +# :FIXME: do we need this? Can we get rid of 'releases'? if [[ -n ${PMODULES_DEFINED_RELEASES} ]]; then declare -r releases="${PMODULES_DEFINED_RELEASES}" else - # set defaults, if file doesn't exist or isn't readable + # set defaults declare -r releases=":unstable:stable:deprecated:" fi +[[ -n ${module_release} ]] && pbuild::set_release "${module_release}" # # run build