commit:     d4c5fb14bbbe3c6c2082651c880c2b4aed02d4c7
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 19 21:45:48 2025 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Oct 19 21:54:33 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d4c5fb14

cmake.eclass: _cmake_modify-cmakelists(): Fix _cmake_minreqver-check call

_cmake_minreqver-check may be called from any phase, so <file> path must be
absolute. As a quick fix, push the path mangling into the output function
_cmake_minreqver-info which (currently) is only called from cmake_prepare.

Closes: https://bugs.gentoo.org/964702
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 eclass/cmake.eclass | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass
index df91ba0f4a0f..bd0294d2ae00 100644
--- a/eclass/cmake.eclass
+++ b/eclass/cmake.eclass
@@ -453,20 +453,26 @@ _cmake_minreqver-info() {
                case ${1} in
                        305)
                                eqawarn "The following CMakeLists.txt files are 
causing errors:"
-                               for info in ${_CMAKE_MINREQVER_CMAKE305[*]}; do 
eqawarn "  ${info}"; done
+                               for info in ${_CMAKE_MINREQVER_CMAKE305[*]}; do
+                                       eqawarn "  ${info#"${CMAKE_USE_DIR}/"}";
+                               done
                                eqawarn
                                ;;
                        310)
                                if [[ -n ${_CMAKE_MINREQVER_CMAKE310[@]} ]]; 
then
                                        eqawarn "The following CMakeLists.txt 
files are causing warnings:"
-                                       for info in 
${_CMAKE_MINREQVER_CMAKE310[*]}; do eqawarn "  ${info}"; done
+                                       for info in 
${_CMAKE_MINREQVER_CMAKE310[*]}; do
+                                               eqawarn "  
${info#"${CMAKE_USE_DIR}/"}";
+                                       done
                                        eqawarn
                                fi
                                ;;
                        316)
                                if [[ ${warnlvl} -ge 316 ]] && [[ -n 
${_CMAKE_MINREQVER_CMAKE316[@]} ]]; then
                                        eqawarn "The following CMakeLists.txt 
files are causing warnings:"
-                                       for info in 
${_CMAKE_MINREQVER_CMAKE316[*]}; do eqawarn "  ${info}"; done
+                                       for info in 
${_CMAKE_MINREQVER_CMAKE316[*]}; do
+                                               eqawarn "  
${info#"${CMAKE_USE_DIR}/"}";
+                                       done
                                        eqawarn
                                fi
                                ;;
@@ -527,7 +533,7 @@ _cmake_modify-cmakelists() {
                fi
                # Detect unsupported minimum CMake versions unless 
CMAKE_QA_COMPAT_SKIP is set
                if ! [[ ${CMAKE_QA_COMPAT_SKIP} ]]; then
-                       _cmake_minreqver-check "${file#"${CMAKE_USE_DIR}/"}"
+                       _cmake_minreqver-check "${file}"
                fi
        done < <(find "${CMAKE_USE_DIR}" -type f -iname "CMakeLists.txt" 
-print0 || die)
 

Reply via email to