Skip to content

Commit 4bfe318

Browse files
authored
Update support.sh: Fix syntax errors
And fix variable names
1 parent 44b4d64 commit 4bfe318

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

support.sh

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,6 @@ function generate_support_info()
370370

371371
local TEMP_DIR_OVERLAY="${TEMP_DIR}/${ALLSKY_OVERLAY/${ALLSKY_HOME}}"
372372
local TEMP_MY_MODULES="${TEMP_DIR}/${ALLSKY_MY_MODULES/${ALLSKY_HOME}}"
373-
local TEMP_DIR_MODULES="${TEMP_DIR}/${ALLSKY_MODULES/${ALLSKY_HOME}}"
374373

375374
# Truncate or delete large files not needed for support.
376375
local X="${TEMP_DIR_OVERLAY}/config/overlay/tmp/de421.bsp"
@@ -427,14 +426,13 @@ function generate_support_info()
427426

428427
# First determine the actual zipped size of what's currently going into the support log.
429428
local TMP_ZIP="${TEMP_DIR}/OTHER_THAN.zip"
430-
local REST_OF_LOG_MB="$( get_actual_size "${TMP_ZIP}" "./*" )"
431-
display_msg --logonly info "Zipped size of everything EXCEPT log files: ${REST_OF_LOG_MB} MB."
432-
local TOTAL_SIZE_MB="${REST_OF_LOG_MB}"
429+
local TOTAL_SIZE_MB="$( get_actual_size "${TMP_ZIP}" "./*" )"
430+
display_msg --logonly info "Zipped size of everything EXCEPT log files: ${TOTAL_SIZE_MB} MB."
433431

434432
local LOG_LINES_TEMP="${LOG_LINES}"
435-
local ESTIMATED_SIZE_MB="$( get_mb --compression-ratio "${COMPRESSION_RATIO}" \
433+
local ESTIMATED_SIZE_LOG_MB="$( get_mb --compression-ratio "${COMPRESSION_RATIO}" \
436434
"${ALLSKY_LOG}" "${ALLSKY_LOG1}" "${ALLSKY_PERIODIC_LOG}" )"
437-
ESTIMATED_SIZE_LOG=$(( ESTIMATED_SIZE_MB + REST_OF_LOG_MB ))
435+
ESTIMATED_SIZE_MB=$(( ESTIMATED_SIZE_LOG_MB + TOTAL_SIZE_MB ))
438436
if [[ ${ESTIMATED_SIZE_MB} -le "${GIT_HUB_LIMIT_MB}" ]]; then
439437
ALL_LOGS=( "${ALLSKY_LOG}" "${ALLSKY_LOG1}" "${ALLSKY_PERIODIC_LOG}" )
440438
MSG="WORST CASE support log size: ${ESTIMATED_SIZE_MB} MB is UNDER limit of ${GIT_HUB_LIMIT_MB} MB."
@@ -447,23 +445,23 @@ function generate_support_info()
447445

448446
# Create a list of logs that exist as well as their size.
449447
if [[ -f ${ALLSKY_LOG} ]]; then
450-
$(( INDEX++ ))
448+
INDEX=$(( INDEX + 1 ))
451449
ALL_LOGS[${INDEX}]="${ALLSKY_LOG}"
452450
TMP_ZIP="${TEMP_DIR}/ALLSKY_LOG.zip"
453451
X_MB="$( get_actual_size "${TMP_ZIP}" "${ALLSKY_LOG}" )"
454452
TOTAL_SIZE_MB=$(( TOTAL_SIZE_MB + X_MB ))
455453
display_msg --logonly info "Zipped size of ${ALLSKY_LOG}: ${X_MB} MB."
456454
fi
457455
if [[ -f ${ALLSKY_LOG1} ]]; then
458-
$(( INDEX++ ))
456+
INDEX=$(( INDEX + 1 ))
459457
ALL_LOGS[${INDEX}]="${ALLSKY_LOG1}"
460458
TMP_ZIP="${TEMP_DIR}/ALLSKY_LOG1.zip"
461459
X_MB="$( get_actual_size "${TMP_ZIP}" "${ALLSKY_LOG1}" )"
462460
TOTAL_SIZE_MB=$(( TOTAL_SIZE_MB + X_MB ))
463461
display_msg --logonly info "Zipped size of ${ALLSKY_LOG1}: ${X_MB} MB."
464462
fi
465463
if [[ -f ${ALLSKY_PERIODIC_LOG} ]]; then
466-
$(( INDEX++ ))
464+
INDEX=$(( INDEX + 1 ))
467465
ALLSKY_LOG1_INDEX="${INDEX}"
468466
ALL_LOGS[${INDEX}]="${ALLSKY_PERIODIC_LOG}"
469467
TMP_ZIP="${TEMP_DIR}/ALLSKY_PERIODIC_LOG.zip"

0 commit comments

Comments
 (0)