diff --git a/ARM.Cortex_DFP.pdsc b/ARM.Cortex_DFP.pdsc index 2bfafd0..8b60cab 100644 --- a/ARM.Cortex_DFP.pdsc +++ b/ARM.Cortex_DFP.pdsc @@ -13,6 +13,12 @@ + + + + + + diff --git a/gen_pack.sh b/gen_pack.sh index 3e7fb99..06896c6 100755 --- a/gen_pack.sh +++ b/gen_pack.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Version: 2.7 -# Date: 2023-05-22 +# Version: 3.0 +# Date: 2023-11-06 # This bash script generates a CMSIS Software Pack: # @@ -9,7 +9,7 @@ set -o pipefail # Set version of gen pack library # For available versions see https://github.com/Open-CMSIS-Pack/gen-pack/tags. # Use the tag name without the prefix "v", e.g., 0.7.0 -REQUIRED_GEN_PACK_LIB="0.8.7" +REQUIRED_GEN_PACK_LIB="0.9.1" # Set default command line arguments DEFAULT_ARGS=(-c "v") @@ -100,43 +100,14 @@ function postprocess() { ############ DO NOT EDIT BELOW ########### -function install_lib() { - local URL="https://github.com/Open-CMSIS-Pack/gen-pack/archive/refs/tags/v$1.tar.gz" - local STATUS=$(curl -sLI "${URL}" | grep "^HTTP" | tail -n 1 | cut -d' ' -f2 || echo "$((600+$?))") - if [[ $STATUS -ge 400 ]]; then - echo "Wrong/unavailable gen-pack lib version '$1'!" >&2 - echo "Check REQUIRED_GEN_PACK_LIB variable." >&2 - echo "For available versions see https://github.com/Open-CMSIS-Pack/gen-pack/tags." >&2 - exit 1 - fi - echo "Downloading gen-pack lib version '$1' to '$2' ..." - mkdir -p "$2" - curl -L "${URL}" -s | tar -xzf - --strip-components 1 -C "$2" || exit 1 -} - -function load_lib() { - if [[ -d ${GEN_PACK_LIB} ]]; then - . "${GEN_PACK_LIB}/gen-pack" - return 0 - fi - local GLOBAL_LIB="/usr/local/share/gen-pack/${REQUIRED_GEN_PACK_LIB}" - local USER_LIB="${HOME}/.local/share/gen-pack/${REQUIRED_GEN_PACK_LIB}" - if [[ ! -d "${GLOBAL_LIB}" && ! -d "${USER_LIB}" ]]; then - echo "Required gen_pack lib not found!" >&2 - install_lib "${REQUIRED_GEN_PACK_LIB}" "${USER_LIB}" - fi - - if [[ -d "${GLOBAL_LIB}" ]]; then - . "${GLOBAL_LIB}/gen-pack" - elif [[ -d "${USER_LIB}" ]]; then - . "${USER_LIB}/gen-pack" - else - echo "Required gen-pack lib is not installed!" >&2 - exit 1 - fi -} +# Set GEN_PACK_LIB_PATH to use a specific gen-pack library root +# ... instead of bootstrap based on REQUIRED_GEN_PACK_LIB +if [[ -f "${GEN_PACK_LIB_PATH}/gen-pack" ]]; then + . "${GEN_PACK_LIB}/gen-pack" +else + . <(curl -sL "https://raw.githubusercontent.com/Open-CMSIS-Pack/gen-pack/main/bootstrap") +fi -load_lib gen_pack "${DEFAULT_ARGS[@]}" "$@" exit 0