commit:     fd83e0781dc2104569963e486fa919c634ff3000
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  4 19:29:56 2025 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Jun  4 19:31:56 2025 +0000
URL:        https://gitweb.gentoo.org/proj/kde.git/commit/?id=fd83e078

cmake.eclass: _cmake_modify-cmakelists(): Consolidate the sed

See also:
https://github.com/gentoo/kde/pull/1046#pullrequestreview-2897140501

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

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

diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass
index e200b39432..07216f0b9f 100644
--- a/eclass/cmake.eclass
+++ b/eclass/cmake.eclass
@@ -254,10 +254,8 @@ _cmake_modify-cmakelists() {
        while read -d '' -r file ; do
                sed \
                        -e 
'/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_BUILD_TYPE\([[:space:]].*)\|)\)/I{s/^/#_cmake_modify_IGNORE
 /g}' \
-                       -e 
'/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_COLOR_MAKEFILE[[:space:]].*)/I{s/^/#_cmake_modify_IGNORE
 /g}' \
-                       -e 
'/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_INSTALL_PREFIX[[:space:]].*)/I{s/^/#_cmake_modify_IGNORE
 /g}' \
-                       -e 
'/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_VERBOSE_MAKEFILE[[:space:]].*)/I{s/^/#_cmake_modify_IGNORE
 /g}' \
-                       -i ${file} || die "${LINENO}: failed to disable 
hardcoded settings"
+                       -e 
'/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_\(COLOR_MAKEFILE\|INSTALL_PREFIX\|VERBOSE_MAKEFILE\)[[:space:]].*)/I{s/^/#_cmake_modify_IGNORE
 /g}' \
+                       -i ${file} || die "failed to disable hardcoded settings"
                readarray -t mod_lines < <(grep -se "^#_cmake_modify_IGNORE" 
${file})
                if [[ ${#mod_lines[*]} -gt 0 ]]; then
                        einfo "Hardcoded definition(s) removed in 
${file/${CMAKE_USE_DIR%\/}\//}:"

Reply via email to