Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/kde:master commit in: eclass/
Date: Fri, 01 Mar 2019 13:29:40
Message-Id: 1551446948.3603015258476c34dde7d805abc9b5474fd6e4dd.asturm@gentoo
1 commit: 3603015258476c34dde7d805abc9b5474fd6e4dd
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 24 13:32:58 2019 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Fri Mar 1 13:29:08 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=36030152
7
8 cmake-utils.eclass: Fix _cmake_modify-cmakelists, add QA output
9
10 Bug: https://bugs.gentoo.org/674768
11 Reported-by: Fabio Rossi <rossi.f <AT> inwind.it>
12 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
13
14 eclass/cmake-utils.eclass | 18 +++++++++++-------
15 1 file changed, 11 insertions(+), 7 deletions(-)
16
17 diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
18 index 77c6d0481c..42a108976f 100644
19 --- a/eclass/cmake-utils.eclass
20 +++ b/eclass/cmake-utils.eclass
21 @@ -419,13 +419,17 @@ _cmake_modify-cmakelists() {
22 grep -qs "<<< Gentoo configuration >>>" "${CMAKE_USE_DIR}"/CMakeLists.txt && return 0
23
24 # Comment out all set (<some_should_be_user_defined_variable> value)
25 - # TODO Add QA checker - inform when variable being checked for below is set in CMakeLists.txt
26 - find "${CMAKE_USE_DIR}" -name CMakeLists.txt \
27 - -exec sed -i -e '/^[[:space:]]*[sS][eE][tT][[:space:]]*([[:space:]]*CMAKE_BUILD_TYPE.*)/{s/^/#IGNORE /g}' {} + \
28 - -exec sed -i -e '/^[[:space:]]*[sS][eE][tT][[:space:]]*([[:space:]]*CMAKE_COLOR_MAKEFILE.*)/{s/^/#IGNORE /g}' {} + \
29 - -exec sed -i -e '/^[[:space:]]*[sS][eE][tT][[:space:]]*([[:space:]]*CMAKE_INSTALL_PREFIX.*)/{s/^/#IGNORE /g}' {} + \
30 - -exec sed -i -e '/^[[:space:]]*[sS][eE][tT][[:space:]]*([[:space:]]*CMAKE_VERBOSE_MAKEFILE.*)/{s/^/#IGNORE /g}' {} + \
31 - || die "${LINENO}: failed to disable hardcoded settings"
32 + find "${CMAKE_USE_DIR}" -name CMakeLists.txt -exec sed \
33 + -e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_BUILD_TYPE[[:space:]].*)/I{s/^/#_cmake_modify_IGNORE /g}' \
34 + -e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_COLOR_MAKEFILE[[:space:]].*)/I{s/^/#_cmake_modify_IGNORE /g}' \
35 + -e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_INSTALL_PREFIX[[:space:]].*)/I{s/^/#_cmake_modify_IGNORE /g}' \
36 + -e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_VERBOSE_MAKEFILE[[:space:]].*)/I{s/^/#G_cmake_modify_IGNORE /g}' \
37 + -i {} + || die "${LINENO}: failed to disable hardcoded settings"
38 + local x
39 + for x in $(find "${CMAKE_USE_DIR}" -name CMakeLists.txt -exec grep -l "^#_cmake_modify_IGNORE" {} +;); do
40 + eqawarn "Hardcoded definition(s) removed in $(echo "${x}" | cut -c $((${#CMAKE_USE_DIR}+2))-):"
41 + eqawarn "$(grep -se '^#_cmake_modify_IGNORE' ${x} | cut -c 22-99)"
42 + done
43
44 # NOTE Append some useful summary here
45 cat >> "${CMAKE_USE_DIR}"/CMakeLists.txt <<- _EOF_ || die