cb424d7448
verify-patch-sanity.py validates every active recipe .patch has internally- consistent hunk line counts — catching the 'malformed patch at line N' failure at commit/CI/preflight time instead of hours into a cook. This cycle hit that class three times (qtwaylandscanner, sddm, xwayland), each only discovered when cookbook tried to apply the patch. Running it across the repo found 29 latent malformed patches (validated against GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22'). They were harmless only because they sit in vendored recipes (baked, not re- applied) — but would fail on any version-bump re-derivation. --fix recounts the hunk headers (body untouched) and repaired all 29. Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test (test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats (empty placeholders, bare-@@ git hunks).
33 lines
1.2 KiB
CMake
33 lines
1.2 KiB
CMake
function(get_fq_target_name local_name target_name_var)
|
|
file(RELATIVE_PATH rel_path ${LIBC_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
|
string(REPLACE "/" "." fq_name "libc.${rel_path}.${local_name}")
|
|
set(${target_name_var} ${fq_name} PARENT_SCOPE)
|
|
endfunction(get_fq_target_name)
|
|
|
|
function(is_relative_target_name target_name output_var)
|
|
string(FIND ${target_name} "." dot_loc)
|
|
string(COMPARE EQUAL "0" ${dot_loc} is_relative)
|
|
set(${output_var} ${is_relative} PARENT_SCOPE)
|
|
endfunction(is_relative_target_name)
|
|
|
|
function(get_fq_dep_name fq_name name)
|
|
is_relative_target_name(${name} "is_relative")
|
|
if(is_relative)
|
|
# Skip over the first '.' character.
|
|
string(SUBSTRING ${name} 1 -1 local_name)
|
|
get_fq_target_name(${local_name} fully_qualified_name)
|
|
set(${fq_name} ${fully_qualified_name} PARENT_SCOPE)
|
|
else()
|
|
set(${fq_name} ${name} PARENT_SCOPE)
|
|
endif()
|
|
endfunction(get_fq_dep_name)
|
|
|
|
function(get_fq_deps_list output_list)
|
|
set(fq_dep_name_list "")
|
|
foreach(dep IN LISTS ARGN)
|
|
get_fq_dep_name(fq_dep_name ${dep})
|
|
list(APPEND fq_dep_name_list ${fq_dep_name})
|
|
endforeach(dep)
|
|
set(${output_list} ${fq_dep_name_list} PARENT_SCOPE)
|
|
endfunction(get_fq_deps_list)
|