Skip to content

Commit

Permalink
Fix logic to decide whether to update the build cache index
Browse files Browse the repository at this point in the history
  • Loading branch information
greenc-FNAL committed Sep 11, 2024
1 parent f2db892 commit 611484b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/build-spack-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,8 @@ EOF
${buildcache_rel_arg} "$cache" \
"${hashes_to_cache[@]/#//}" ||
_die "failure caching packages to $cache"
if [ -f "$cache/build_cache/index.json" ]; then
if [ -d "$cache/build_cache" ] &&
(( $({ ls -1 "$cache/build_cache/*.json*" | wc -l; } 2>/dev/null) )); then
_report $PROGRESS "updating build cache index at $cache"
_cmd $DEBUG_1 $PROGRESS \
spack \
Expand Down

0 comments on commit 611484b

Please sign in to comment.