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 C74C51382C5 for ; Fri, 26 Jan 2018 06:40:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BC8B8E089A; Fri, 26 Jan 2018 06:40:27 +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 99002E089A for ; Fri, 26 Jan 2018 06:40:27 +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 4B4DD335C2E for ; Fri, 26 Jan 2018 06:40:26 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9765B1CF for ; Fri, 26 Jan 2018 06:40:24 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1516948802.a03d0f3d4b6aa58df7b6f9dd9d76c45128455ec1.mgorny@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/install-qa-check.d/ X-VCS-Repository: proj/portage X-VCS-Files: bin/install-qa-check.d/90cmake-warnings X-VCS-Directories: bin/install-qa-check.d/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: a03d0f3d4b6aa58df7b6f9dd9d76c45128455ec1 X-VCS-Branch: master Date: Fri, 26 Jan 2018 06:40:24 +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-Archives-Salt: d666c49c-b13a-498e-ad6c-ea3bb0f72723 X-Archives-Hash: 43451528eae22bb3acd8afb7f0071f6a commit: a03d0f3d4b6aa58df7b6f9dd9d76c45128455ec1 Author: Michał Górny gentoo org> AuthorDate: Thu Jan 25 09:07:36 2018 +0000 Commit: Michał Górny gentoo org> CommitDate: Fri Jan 26 06:40:02 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=a03d0f3d install-qa-check.d: Scan build log for CMake unused var warnings Scan build log and report verbosely CMake warnings about unused variables. This is a quite common problem, yet currently it is hard to notice it since the warning is mixed with src_configure() output. Repeat it verbosely after the install. This check outputs warnings such as: * One or more CMake variables were not used by the project: * CMAKE_USER_MAKE_RULES_OVERRIDE Reviewed-by: Zac Medico gentoo.org> bin/install-qa-check.d/90cmake-warnings | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/bin/install-qa-check.d/90cmake-warnings b/bin/install-qa-check.d/90cmake-warnings new file mode 100644 index 000000000..a6e901efc --- /dev/null +++ b/bin/install-qa-check.d/90cmake-warnings @@ -0,0 +1,28 @@ +# Check for CMake invalid option warnings + +cmake_warn_check() { + if [[ -n ${PORTAGE_LOG_FILE} && -r ${PORTAGE_LOG_FILE} ]] ; then + local cat=cat + [[ ${PORTAGE_LOG_FILE} == *.gz ]] && cat=zcat + + local vars=() + while read -r l; do + vars+=( "${l}" ) + done < <( "${cat}" "${PORTAGE_LOG_FILE}" \ + | sed -n -e '/Manually-specified variables were not used by the project/,/^--/{/^ /p}' \ + | LC_ALL=C sort -u) + + if [[ ${vars} ]]; then + eqawarn "One or more CMake variables were not used by the project:" + local v + for v in "${vars[@]}"; do + eqawarn " ${v}" + done + fi + fi +} + +cmake_warn_check +: # guarantee successful exit + +# vim:ft=sh