From e17db5d062c8f8aed4f991ff542543cd4912bf6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Sainl=C3=A9ger?= Date: Mon, 2 Feb 2026 21:58:13 +0100 Subject: [PATCH] [IMP] simplify migration path construction with seq Replace manual loop building version array with seq + readarray: Before (4 lines): declare -a versions nb_migrations=$((FINAL_VERSION - ORIGIN_VERSION)) for ((i = 0; i < nb_migrations; i++)); do versions[i]=$((ORIGIN_VERSION + 1 + i)) done After (1 line): readarray -t versions < <(seq $((ORIGIN_VERSION + 1)) "$FINAL_VERSION") The seq command is purpose-built for generating number sequences, making the intent clearer and the code more concise. --- upgrade.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/upgrade.sh b/upgrade.sh index 099ae02..28d575f 100755 --- a/upgrade.sh +++ b/upgrade.sh @@ -111,12 +111,7 @@ log_info "Original filestore copied." log_step "PATH OF MIGRATION" -declare -a versions -nb_migrations=$((FINAL_VERSION - ORIGIN_VERSION)) - -for ((i = 0; i < nb_migrations; i++)); do - versions[i]=$((ORIGIN_VERSION + 1 + i)) -done +readarray -t versions < <(seq $((ORIGIN_VERSION + 1)) "$FINAL_VERSION") log_info "Migration path is ${versions[*]}"