Skip to content

Commit

Permalink
Detect Spack support of --type option to spack mirror add
Browse files Browse the repository at this point in the history
  • Loading branch information
greenc-FNAL committed Dec 5, 2023
1 parent 3268abd commit c1b3a3c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/build-spack-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ EOF
_cache_info() {
if [[ "$cache_spec" =~ ^(([^|]+)\|)?((source|binary):)?(.*)$ ]]; then
cache_name="${BASH_REMATCH[2]:-buildcache_$((++cache_count))}"
cache_type="${BASH_REMATCH[4]}"
(( have_mirror_add_type )) && cache_type="${BASH_REMATCH[4]}"
cache_url="${BASH_REMATCH[5]}"
else
_die $EXIT_SPACK_CONFIG_FAILURE "unable to parse cache_spec \"$cache_spec\""
Expand Down Expand Up @@ -528,6 +528,12 @@ _configure_spack() {
buildcache_rel_arg="-r"
####################################

####################################
# Check whether spack mirror add supports --type
mirror_add_help="$(spack mirror add --help | grep -Ee '^[[:space:]]--type[[:space:]]+')"
[ -n "$mirror_add_help" ] && have_mirror_add_type=1
####################################

####################################
# Make sure we know about compilers.
_report $PROGRESS "configuring compilers"
Expand Down

0 comments on commit c1b3a3c

Please sign in to comment.