Fix sense of device set membership checks

The flasher Bash script uses a neat `"${FILENAME##*"$variant"*}"` Bash trick to replace any string in `FILENAME` containing the string in `variant` with an empty string. It puts this in loops over arrays to check if `FILENAME` contains any `variant` in the list.

But the test needs to be `-z` (i.e. match the empty string, which we get if we found `variant`) if we want to operate on filenames that have any items from the list. With `-n` we pass the condition if we *don't* find the variant, and then operate on filenames that *don't* have *every* variant from the list.
pull/6517/head
interfect 2025-04-07 20:33:24 -04:00 zatwierdzone przez GitHub
rodzic a084073cc1
commit 2fd41c0424
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -138,7 +138,7 @@ if [ -f "${FILENAME}" ] && [ -n "${FILENAME##*"update"*}" ]; then
# littlefs* offset for BigDB 8mb and OTA OFFSET.
for variant in "${BIGDB_8MB[@]}"; do
if [ -n "${FILENAME##*"$variant"*}" ]; then
if [ -z "${FILENAME##*"$variant"*}" ]; then
OFFSET=0x670000
OTA_OFFSET=0x340000
fi
@ -146,7 +146,7 @@ if [ -f "${FILENAME}" ] && [ -n "${FILENAME##*"update"*}" ]; then
# littlefs* offset for BigDB 16mb and OTA OFFSET.
for variant in "${BIGDB_16MB[@]}"; do
if [ -n "${FILENAME##*"$variant"*}" ]; then
if [ -z "${FILENAME##*"$variant"*}" ]; then
OFFSET=0xc90000
OTA_OFFSET=0x650000
fi
@ -155,7 +155,7 @@ if [ -f "${FILENAME}" ] && [ -n "${FILENAME##*"update"*}" ]; then
# Account for S3 board's different OTA partition
# FIXME: Use PlatformIO info to determine MCU type, this is unmaintainable
for variant in "${S3_VARIANTS[@]}"; do
if [ -n "${FILENAME##*"$variant"*}" ]; then
if [ -z "${FILENAME##*"$variant"*}" ]; then
MCU="esp32s3"
fi
done