From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 269BE138359 for ; Sun, 30 Aug 2020 19:02:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4F5A5E0AE8; Sun, 30 Aug 2020 19:02:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 30EA6E0AE4 for ; Sun, 30 Aug 2020 19:02:23 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B965E340DDB for ; Sun, 30 Aug 2020 19:02:21 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0290D33F for ; Sun, 30 Aug 2020 19:02:19 +0000 (UTC) From: "Andreas Sturmlechner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" Message-ID: <1598808183.16bf0280919858f9a2f9b93f7668396c3a66a1e8.asturm@gentoo> Subject: [gentoo-commits] proj/kde:master commit in: eclass/ X-VCS-Repository: proj/kde X-VCS-Files: eclass/cmake.eclass X-VCS-Directories: eclass/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: 16bf0280919858f9a2f9b93f7668396c3a66a1e8 X-VCS-Branch: master Date: Sun, 30 Aug 2020 19:02:19 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 6d0818a6-bcb8-4135-a13a-142fc5e995f7 X-Archives-Hash: 1ac14ca23616d26284f1343e14f8a80a commit: 16bf0280919858f9a2f9b93f7668396c3a66a1e8 Author: Andreas Sturmlechner gentoo org> AuthorDate: Sun Aug 30 17:13:07 2020 +0000 Commit: Andreas Sturmlechner gentoo org> CommitDate: Sun Aug 30 17:23:03 2020 +0000 URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=16bf0280 cmake.eclass: cmake_comment_add_subdirectory: line length reduction Signed-off-by: Andreas Sturmlechner gentoo.org> eclass/cmake.eclass | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass index 240ab87bf6..d9fb203ede 100644 --- a/eclass/cmake.eclass +++ b/eclass/cmake.eclass @@ -169,16 +169,17 @@ cmake_run_in() { # Comment out one or more add_subdirectory calls in CMakeLists.txt in the current directory cmake_comment_add_subdirectory() { if [[ -z ${1} ]]; then - die "comment_add_subdirectory must be passed at least one directory name to comment" + die "${FUNCNAME[0]} must be passed at least one directory name to comment" fi - if [[ -e "CMakeLists.txt" ]]; then - local d - for d in $@; do - sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${d//\//\\/}[[:space:]]*)/I s/^/#DONOTCOMPILE /" \ - -i CMakeLists.txt || die "failed to comment add_subdirectory(${d})" - done - fi + [[ -e "CMakeLists.txt" ]] || return + + local d + for d in $@; do + d=${d//\//\\/} + sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${d}[[:space:]]*)/I s/^/#DONOTCOMPILE /" \ + -i CMakeLists.txt || die "failed to comment add_subdirectory(${d})" + done } # @FUNCTION: comment_add_subdirectory