Skip to content

Commit fc3bf6e

Browse files
feat: improve R/RC detection method
1 parent 30ee99c commit fc3bf6e

1 file changed

Lines changed: 30 additions & 11 deletions

File tree

releng/update-site-tests/detect-latest-eclipse-steams.sh

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,26 @@ ESP_IDE_BASE="https://dl.espressif.com/dl/idf-eclipse-plugin/ide"
1010
echo "Fetching Eclipse release list from $RELEASE_XML"
1111
XML="$(curl -fsSL "$RELEASE_XML")"
1212

13-
TOKENS="$(printf '%s\n' "$XML" | tr ' ' '\n' | sed '/^$/d')"
14-
1513
ECLIPSE_R_RELEASE="$(
16-
printf '%s\n' "$TOKENS" \
17-
| grep -E '^[0-9]{4}-[0-9]{2}/R$' \
18-
| sed 's|/R||' \
14+
printf '%s\n' "$XML" \
15+
| grep -oE '[0-9]{4}-[0-9]{2}/R([^A-Za-z0-9]|$)' \
16+
| sed -E 's|/R([^A-Za-z0-9].*)?$||' \
1917
| sort -r \
2018
| head -n1
2119
)"
2220

21+
# Latest milestone - optional
2322
ECLIPSE_M_RELEASE="$(
24-
printf '%s\n' "$TOKENS" \
25-
| grep -E '^[0-9]{4}-[0-9]{2}/M[0-9]+$' \
23+
printf '%s\n' "$XML" \
24+
| grep -oE '[0-9]{4}-[0-9]{2}/M[0-9]+' \
2625
| sort -r \
2726
| head -n1 || true
2827
)"
2928

29+
# Latest RC - optional
3030
ECLIPSE_RC_RELEASE="$(
31-
printf '%s\n' "$TOKENS" \
32-
| grep -E '^[0-9]{4}-[0-9]{2}/RC[0-9]+$' \
31+
printf '%s\n' "$XML" \
32+
| grep -oE '[0-9]{4}-[0-9]{2}/RC[0-9]+' \
3333
| sort -r \
3434
| head -n1 || true
3535
)"
@@ -57,11 +57,29 @@ if [[ -z "${ECLIPSE_R_RELEASE:-}" ]]; then
5757
exit 1
5858
fi
5959

60-
# Build URLs (stable)
60+
if [[ -z "${ECLIPSE_M_RELEASE:-}" ]]; then
61+
echo "⚠️ No latest milestone detected. (/M*)."
62+
fi
63+
64+
if [[ -z "${ECLIPSE_RC_RELEASE:-}" ]]; then
65+
echo "⚠️ No latest RC detected. (/RC*)."
66+
fi
67+
68+
# Build URLs
6169
ECLIPSE_R_URL="$EPP_BASE/$ECLIPSE_R_RELEASE/R/eclipse-cpp-$ECLIPSE_R_RELEASE-R-linux-gtk-x86_64.tar.gz"
6270
ECLIPSE_R_P2="https://download.eclipse.org/releases/$ECLIPSE_R_RELEASE"
6371

64-
# Verify URLs exist (stable) - non-fatal
72+
ECLIPSE_M_URL=""
73+
ECLIPSE_M_P2=""
74+
75+
if [[ -n "${ECLIPSE_M_RELEASE:-}" ]]; then
76+
STREAM="${ECLIPSE_M_RELEASE%/*}" # 2026-03
77+
M_TAG="${ECLIPSE_M_RELEASE#*/}" # M2
78+
ECLIPSE_M_URL="$EPP_BASE/$STREAM/$M_TAG/eclipse-cpp-$STREAM-$M_TAG-linux-gtk-x86_64.tar.gz"
79+
ECLIPSE_M_P2="https://download.eclipse.org/releases/$STREAM"
80+
fi
81+
82+
# Verify URLs exist
6583
if ! curl -fsI "$ECLIPSE_R_URL" >/dev/null; then
6684
echo "⚠️ Could not verify Eclipse archive URL. Continuing anyway."
6785
fi
@@ -96,6 +114,7 @@ ESP_IDE_VERSION="${ESP_IDE_TAG#v}"
96114
ESPRESSIF_IDE_URL="$ESP_IDE_BASE/Espressif-IDE-${ESP_IDE_VERSION}-linux.gtk.x86_64.tar.gz"
97115

98116
echo "Verifying Espressif-IDE archive exists..."
117+
99118
if ! curl -sfI "$ESPRESSIF_IDE_URL" >/dev/null; then
100119
echo "⚠️ Could not verify Espressif-IDE archive URL. Continuing anyway."
101120
fi

0 commit comments

Comments
 (0)