Meta: Use SHA-256 verification for downloaded CLDR files

This commit is contained in:
Timothy Flynn 2024-05-23 12:18:53 -04:00 committed by Tim Flynn
parent 4ce7f49f2f
commit 4d65a073b5
2 changed files with 9 additions and 5 deletions

View file

@ -1,6 +1,8 @@
include(${CMAKE_CURRENT_LIST_DIR}/utils.cmake)
set(CLDR_VERSION 45.0.0)
set(CLDR_VERSION "45.0.0")
set(CLDR_SHA256 "ba934cdd40ad4fb6439004c7e746bef97fe2b597db1040fcaa6c7d0647742c1b")
set(CLDR_PATH "${SERENITY_CACHE_DIR}/CLDR" CACHE PATH "Download location for CLDR files")
set(CLDR_VERSION_FILE "${CLDR_PATH}/version.txt")
@ -32,7 +34,7 @@ if (ENABLE_UNICODE_DATABASE_DOWNLOAD)
remove_path_if_version_changed("${CLDR_VERSION}" "${CLDR_VERSION_FILE}" "${CLDR_PATH}")
if (ENABLE_NETWORK_DOWNLOADS)
download_file("${CLDR_ZIP_URL}" "${CLDR_ZIP_PATH}")
download_file("${CLDR_ZIP_URL}" "${CLDR_ZIP_PATH}" SHA256 "${CLDR_SHA256}")
extract_path("${CLDR_PATH}" "${CLDR_ZIP_PATH}" "${CLDR_BCP47_SOURCE}/**" "${CLDR_BCP47_PATH}")
extract_path("${CLDR_PATH}" "${CLDR_ZIP_PATH}" "${CLDR_CORE_SOURCE}/**" "${CLDR_CORE_PATH}")
extract_path("${CLDR_PATH}" "${CLDR_ZIP_PATH}" "${CLDR_DATES_SOURCE}/**" "${CLDR_DATES_PATH}")

View file

@ -6,14 +6,16 @@ import("//Userland/Libraries/LibUnicode/enable_unicode_download.gni")
locale_cache = cache_path + "CLDR/"
locale_version = "45.0.0"
if (enable_unicode_database_download) {
download_file("locale_database_download") {
version = "45.0.0"
url = "https://github.com/unicode-org/cldr-json/releases/download/" +
version + "/cldr-" + version + "-json-modern.zip"
version = locale_version
url = "https://github.com/unicode-org/cldr-json/releases/download/$version/cldr-$version-json-modern.zip"
cache = locale_cache
output = "cldr.zip"
version_file = "version.txt"
sha256 = "ba934cdd40ad4fb6439004c7e746bef97fe2b597db1040fcaa6c7d0647742c1b"
}
extract_archive_contents("locale_database_files") {