cmake: Fix gettext pot update check.
When the feature was added in d93f6350
, I did not adequately test for
the normal case when the pot is not updated.
This does not work because the pot has a timestamp in the
POT-Creation-Date: field.
Fix check-pot-update.cmake to ignore the pot timestamp and not report
the pot as changed when it has not been.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
parent
2504596140
commit
89d378eb71
|
@ -2,9 +2,22 @@ if(NOT EXISTS ${BIN_DIR}/wxvbam.pot)
|
|||
return()
|
||||
endif()
|
||||
|
||||
file(READ ${SRC_DIR}/wxvbam.pot src_ver)
|
||||
macro(read_pot path var)
|
||||
file(READ ${path} ${var}_file)
|
||||
|
||||
file(READ ${BIN_DIR}/wxvbam.pot new_ver)
|
||||
string(REGEX REPLACE ";" "\\\\;" ${var}_file ${${var}_file})
|
||||
string(REGEX REPLACE "\r?\n" ";" ${var}_file ${${var}_file})
|
||||
|
||||
# Ignore timestamp.
|
||||
foreach(line IN LISTS ${var}_file)
|
||||
if(NOT line MATCHES [=[^"POT-Creation-Date: ]=])
|
||||
list(APPEND ${var} ${line})
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
read_pot(${SRC_DIR}/wxvbam.pot src_ver)
|
||||
read_pot(${BIN_DIR}/wxvbam.pot new_ver)
|
||||
|
||||
if(NOT src_ver STREQUAL new_ver)
|
||||
file(COPY ${BIN_DIR}/wxvbam.pot DESTINATION ${SRC_DIR})
|
||||
|
|
Loading…
Reference in New Issue