Skip to content

Commit 257e220

Browse files
committed
tools: compare ICU checksums before file changes
Otherwise we end up with an bad update PR when checksums don't match. Refs: #50495 PR-URL: #50522 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent b740324 commit 257e220

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tools/dep_updaters/update-icu.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,23 @@ NEW_VERSION_TGZ_URL="https://github.com/unicode-org/icu/releases/download/releas
4242

4343
NEW_VERSION_MD5="https://github.com/unicode-org/icu/releases/download/release-${DASHED_NEW_VERSION}/icu4c-${LOW_DASHED_NEW_VERSION}-src.md5"
4444

45-
./configure --with-intl=full-icu --with-icu-source="$NEW_VERSION_TGZ_URL"
46-
47-
"$TOOLS_DIR/icu/shrink-icu-src.py"
48-
49-
rm -rf "$DEPS_DIR/icu"
50-
5145
CHECKSUM=$(curl -sL "$NEW_VERSION_MD5" | grep "$NEW_VERSION_TGZ" | grep -v "\.asc$" | awk '{print $1}')
5246

5347
GENERATED_CHECKSUM=$( curl -sL "$NEW_VERSION_TGZ_URL" | md5sum | cut -d ' ' -f1)
5448

55-
echo "Comparing checksums: deposited $CHECKSUM with $GENERATED_CHECKSUM"
49+
echo "Comparing checksums: deposited '$CHECKSUM' with '$GENERATED_CHECKSUM'"
5650

5751
if [ "$CHECKSUM" != "$GENERATED_CHECKSUM" ]; then
5852
echo "Skipped because checksums do not match."
5953
exit 0
6054
fi
6155

56+
./configure --with-intl=full-icu --with-icu-source="$NEW_VERSION_TGZ_URL"
57+
58+
"$TOOLS_DIR/icu/shrink-icu-src.py"
59+
60+
rm -rf "$DEPS_DIR/icu"
61+
6262
perl -i -pe "s|\"url\": .*|\"url\": \"$NEW_VERSION_TGZ_URL\",|" "$TOOLS_DIR/icu/current_ver.dep"
6363

6464
perl -i -pe "s|\"md5\": .*|\"md5\": \"$CHECKSUM\"|" "$TOOLS_DIR/icu/current_ver.dep"

0 commit comments

Comments
 (0)