Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PROJ_DB_SQL_EXPECTED_MD5: do not make it sensitive to PROJ_VERSION or… #4340

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions HOWTO-RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,6 @@ version numbers in the files.
- CMakeLists.txt: Update proj_version()
- docs/source/conf.py: Update version number

Given the update of the PROJ_VERSION number, the expected MD5SUM of the database
SQL files will be modified. Run a build, and update the PROJ_DB_SQL_EXPECTED_MD5
variable in data/CMakeLists.txt with the value that CMake will provide in an
error message.

*Commit changes. Either to master or maintenance branch depending on the nature
of the release.*

Expand Down
2 changes: 1 addition & 1 deletion data/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ set(ALL_SQL_IN "${CMAKE_CURRENT_BINARY_DIR}/all.sql.in")
set(PROJ_DB "${CMAKE_CURRENT_BINARY_DIR}/proj.db")
include(sql_filelist.cmake)

set(PROJ_DB_SQL_EXPECTED_MD5 "78cbab972fc752d68dc92e1ecba5240e")
set(PROJ_DB_SQL_EXPECTED_MD5 "3d51445a31ba6980332fa8e2348f7b16")

add_custom_command(
OUTPUT ${PROJ_DB}
Expand Down
10 changes: 5 additions & 5 deletions data/generate_proj_db.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ function(generate_all_sql_in ALL_SQL_IN_FILENAME EXTRA_VALIDATION OUT_MD5)
cat(${SQL_FILE} "${ALL_SQL_IN_FILENAME}")
endforeach()

# Compute the MD5 before PROJ_VERSION substitution to avoid updating the
# expected MD5 if we just bump the PROJ_VERSION
configure_file("${ALL_SQL_IN_FILENAME}" "${ALL_SQL_IN_FILENAME}.tmp" NEWLINE_STYLE UNIX)
file(MD5 "${ALL_SQL_IN_FILENAME}.tmp" OUT_MD5_LOCAL)
# Compute the MD5 before any records in the metadata table, to avoid
# refreshing the MD5 if we bump PROJ_VERSION or PROJ_DATA.VERSION
file(READ ${ALL_SQL_IN_FILENAME} CONTENTS)
string(REGEX REPLACE "INSERT INTO \\\"metadata\\\"[^\n]*\n?" "" CONTENTS_WITHOUT_METADATA "${CONTENTS}")
string(MD5 OUT_MD5_LOCAL "${CONTENTS_WITHOUT_METADATA}")
set(${OUT_MD5} "${OUT_MD5_LOCAL}" PARENT_SCOPE)

# Do ${PROJ_VERSION} substitution
file(READ ${ALL_SQL_IN_FILENAME} CONTENTS)
string(REPLACE "\${PROJ_VERSION}" "${PROJ_VERSION}" CONTENTS_MOD "${CONTENTS}")
file(WRITE "${ALL_SQL_IN_FILENAME}" "${CONTENTS_MOD}")
endfunction()
Expand Down
Loading