Skip to content

Commit

Permalink
Meta: Use SHA-256 verification for downloaded TZDB files
Browse files Browse the repository at this point in the history
  • Loading branch information
trflynn89 committed May 24, 2024
1 parent 4d65a07 commit 3b2c8d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 4 additions & 3 deletions Meta/CMake/time_zone_data.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
include(${CMAKE_CURRENT_LIST_DIR}/utils.cmake)

set(TZDB_PATH "${SERENITY_CACHE_DIR}/TZDB" CACHE PATH "Download location for TZDB files")
set(TZDB_VERSION "2024a")
set(TZDB_SHA256 "0d0434459acbd2059a7a8da1f3304a84a86591f6ed69c6248fffa502b6edffe3")

set(TZDB_VERSION 2024a)
set(TZDB_PATH "${SERENITY_CACHE_DIR}/TZDB" CACHE PATH "Download location for TZDB files")
set(TZDB_VERSION_FILE "${TZDB_PATH}/version.txt")

set(TZDB_ZIP_URL "https://data.iana.org/time-zones/releases/tzdata${TZDB_VERSION}.tar.gz")
Expand Down Expand Up @@ -46,7 +47,7 @@ if (ENABLE_TIME_ZONE_DATABASE_DOWNLOAD)
remove_path_if_version_changed("${TZDB_VERSION}" "${TZDB_VERSION_FILE}" "${TZDB_PATH}")

if (ENABLE_NETWORK_DOWNLOADS)
download_file("${TZDB_ZIP_URL}" "${TZDB_ZIP_PATH}")
download_file("${TZDB_ZIP_URL}" "${TZDB_ZIP_PATH}" SHA256 "${TZDB_SHA256}")
extract_tzdb_file("${TZDB_AFRICA_SOURCE}" "${TZDB_AFRICA_PATH}")
extract_tzdb_file("${TZDB_ANTARCTICA_SOURCE}" "${TZDB_ANTARCTICA_PATH}")
extract_tzdb_file("${TZDB_ASIA_SOURCE}" "${TZDB_ASIA_PATH}")
Expand Down
8 changes: 5 additions & 3 deletions Meta/gn/secondary/Userland/Libraries/LibTimeZone/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ declare_args() {

tzdb_cache = cache_path + "TZDB/"

tzdb_version = "2024a"

if (enable_timezone_database_download) {
download_file("timezone_database_download") {
version = "2024a"
url =
"https://data.iana.org/time-zones/releases/tzdata" + version + ".tar.gz"
version = tzdb_version
url = "https://data.iana.org/time-zones/releases/tzdata$version.tar.gz"
cache = tzdb_cache
output = "tzdb.tar.gz"
version_file = "version.txt"
sha256 = "0d0434459acbd2059a7a8da1f3304a84a86591f6ed69c6248fffa502b6edffe3"
}
extract_archive_contents("timezone_database_files") {
deps = [ ":timezone_database_download" ]
Expand Down

0 comments on commit 3b2c8d0

Please sign in to comment.