Commit 92862553 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Declare associative arrays early.

* This way assignments like package_inst[eccodes]=/path/to/eccodes can
  be passed on the command line just like regular variable assignments.
parent 21ce018a
......@@ -4,7 +4,9 @@
set -eux
# syspkg is an associative array where package keys are to be used
# from system instead of building them ourselves
declare -A syspkg
declare -A syspkg packages_dl package_names package_inst \
package_git package_git_branch package_git_commit \
fresh_unpack
for ((i=1; i <= $#; ++i))
do
arg=${!i}
......@@ -82,7 +84,6 @@ esac
#
# components to download:
#
declare -A packages_dl
packages_dl=(
[libaec]='https://gitlab.dkrz.de/k202009/libaec/uploads/ea0b7d197a950b0c110da8dfdecbb71f/libaec-1.0.4.tar.gz'
[hdf5]='https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0/src/hdf5-1.12.0.tar.gz'
......@@ -99,7 +100,6 @@ packages_dl=(
CC_rpath_flag=${CC_rpath_flag--Wl,-rpath,}
FC_rpath_flag=${FC_rpath_flag--Wl,-rpath,}
declare -A package_git package_git_branch package_git_commit
package_git=([cdi]='https://gitlab.dkrz.de/mpim-sw/libcdi.git'
#[yaxt]='https://gitlab.dkrz.de/dkrz-sw/yaxt.git'
[ppm]='https://gitlab.dkrz.de/jahns/ppm.git')
......@@ -137,7 +137,6 @@ NC_H5_CACHE_SIZE=4194304
NC_H5_CHUNK_CACHE_NELEMS=1009
# derive version-qualified names
declare -A package_names package_inst
for package_key in ${packages_dl[@]+"${!packages_dl[@]}"}; do
[[ x${syspkg[$package_key]+set} != xset ]] || continue
package_url=${packages_dl[$package_key]}
......@@ -184,7 +183,6 @@ case ${stages} in
;;
esac
declare -A fresh_unpack
case ${stages} in
*-unpack-*)
cd "$srcdir"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment