From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 8AC441389AD for ; Mon, 27 Oct 2014 19:29:02 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9DA8AE0872; Mon, 27 Oct 2014 19:29:01 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0FA29E0872 for ; Mon, 27 Oct 2014 19:29:00 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 092603404E8 for ; Mon, 27 Oct 2014 19:29:00 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A9D658E02 for ; Mon, 27 Oct 2014 19:28:58 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1414437688.ab43c1944f0cb6bf43d5b40cceb2e8186645d347.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/isolated-functions.sh bin/save-ebuild-env.sh X-VCS-Directories: bin/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: ab43c1944f0cb6bf43d5b40cceb2e8186645d347 X-VCS-Branch: master Date: Mon, 27 Oct 2014 19:28:58 +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: 875dc027-911f-4444-aadc-776ff0436b92 X-Archives-Hash: 90e10cbfbb8303b9b7ec24be65755928 commit: ab43c1944f0cb6bf43d5b40cceb2e8186645d347 Author: Michael Palimaka gentoo org> AuthorDate: Sun Oct 26 15:12:08 2014 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Oct 27 19:21:28 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ab43c194 Introduce eqalog and eqawarnlog functions. These functions are to be used for creating a log of QA violations in a machine-readable format. Stored in ${T]/qa.log, the log consists of one entry per line in the following format: violation-tag data For example: deprecated-directory /usr/man deprecated-directory /usr/info world-writable /var/db/foo/bar Signed-off-by: Zac Medico gentoo.org> Acked-by: Alexander Berntsen gentoo.org> --- bin/isolated-functions.sh | 23 +++++++++++++++++++++++ bin/save-ebuild-env.sh | 1 + 2 files changed, 24 insertions(+) diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index a22af57..4992d77 100644 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -256,6 +256,29 @@ __elog_base() { return 0 } +__eqalog() { + local tag=$1 x + shift + for x in "$@" ; do + echo "${tag}" "${x}"| ( + escape="" + while read -r ; do + echo -n "${escape}${REPLY}" + escape="\\n" + done + echo + ) >> "${T}"/qa.log + done +} + +__eqawarnlog() { + __eqalog "$@" + shift + for x in "$@" ; do + eqawarn " ${x}" + done +} + eqawarn() { __elog_base QA "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh index 775c02c..dd233a9 100644 --- a/bin/save-ebuild-env.sh +++ b/bin/save-ebuild-env.sh @@ -76,6 +76,7 @@ __save_ebuild_env() { __ebuild_arg_to_phase __ebuild_phase_funcs default \ __unpack_tar __unset_colors \ __source_env_files __try_source \ + __eqalog __eqawarnlog \ ${QA_INTERCEPTORS} ___eapi_has_usex && unset -f usex