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: Sun, 30 Aug 2020 19:02:25
Message-Id: 1598808183.16bf0280919858f9a2f9b93f7668396c3a66a1e8.asturm@gentoo
1 commit: 16bf0280919858f9a2f9b93f7668396c3a66a1e8
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sun Aug 30 17:13:07 2020 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sun Aug 30 17:23:03 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=16bf0280
7
8 cmake.eclass: cmake_comment_add_subdirectory: line length reduction
9
10 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
11
12 eclass/cmake.eclass | 17 +++++++++--------
13 1 file changed, 9 insertions(+), 8 deletions(-)
14
15 diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass
16 index 240ab87bf6..d9fb203ede 100644
17 --- a/eclass/cmake.eclass
18 +++ b/eclass/cmake.eclass
19 @@ -169,16 +169,17 @@ cmake_run_in() {
20 # Comment out one or more add_subdirectory calls in CMakeLists.txt in the current directory
21 cmake_comment_add_subdirectory() {
22 if [[ -z ${1} ]]; then
23 - die "comment_add_subdirectory must be passed at least one directory name to comment"
24 + die "${FUNCNAME[0]} must be passed at least one directory name to comment"
25 fi
26
27 - if [[ -e "CMakeLists.txt" ]]; then
28 - local d
29 - for d in $@; do
30 - sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${d//\//\\/}[[:space:]]*)/I s/^/#DONOTCOMPILE /" \
31 - -i CMakeLists.txt || die "failed to comment add_subdirectory(${d})"
32 - done
33 - fi
34 + [[ -e "CMakeLists.txt" ]] || return
35 +
36 + local d
37 + for d in $@; do
38 + d=${d//\//\\/}
39 + sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${d}[[:space:]]*)/I s/^/#DONOTCOMPILE /" \
40 + -i CMakeLists.txt || die "failed to comment add_subdirectory(${d})"
41 + done
42 }
43
44 # @FUNCTION: comment_add_subdirectory