Fixed patch matching to skip non-submodule dirs and empty applies.

Esse commit está contido em:
23rd
2026-04-25 14:39:23 +03:00
commit f4e65a34ad
+5 -4
Ver Arquivo
@@ -21,16 +21,17 @@ foreach(_patch ${_submodule_patches})
while(_n GREATER 0 AND NOT _applied) while(_n GREATER 0 AND NOT _applied)
list(SUBLIST _parts 0 ${_n} _head) list(SUBLIST _parts 0 ${_n} _head)
string(REPLACE ";" "_" _candidate "${_head}") string(REPLACE ";" "_" _candidate "${_head}")
foreach(_root "" "Telegram/") foreach(_root "Telegram/" "")
set(_dir "${CMAKE_SOURCE_DIR}/${_root}${_candidate}") set(_dir "${CMAKE_SOURCE_DIR}/${_root}${_candidate}")
if (IS_DIRECTORY ${_dir}) if (IS_DIRECTORY ${_dir} AND EXISTS ${_dir}/.git)
execute_process( execute_process(
COMMAND git apply --check ${_patch} COMMAND git apply --check ${_patch}
WORKING_DIRECTORY ${_dir} WORKING_DIRECTORY ${_dir}
RESULT_VARIABLE _check_result RESULT_VARIABLE _check_result
OUTPUT_QUIET ERROR_QUIET OUTPUT_VARIABLE _check_output
ERROR_VARIABLE _check_output
) )
if (_check_result EQUAL 0) if (_check_result EQUAL 0 AND NOT _check_output MATCHES "Skipped patch")
execute_process( execute_process(
COMMAND git apply ${_patch} COMMAND git apply ${_patch}
WORKING_DIRECTORY ${_dir} WORKING_DIRECTORY ${_dir}