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 44168138330 for ; Tue, 23 Aug 2016 17:26:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AFFFB21C1B7; Tue, 23 Aug 2016 17:26:05 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4512421C188 for ; Tue, 23 Aug 2016 17:26:04 +0000 (UTC) Received: from vm-gentoo-x64.intern.deutschmann.biz (p2003000611285F34396ED2C8CA386A1B.dip0.t-ipconnect.de [IPv6:2003:6:1128:5f34:396e:d2c8:ca38:6a1b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: whissi) by smtp.gentoo.org (Postfix) with ESMTPSA id 1173D340806 for ; Tue, 23 Aug 2016 17:26:01 +0000 (UTC) From: Thomas Deutschmann To: gentoo-dev@lists.gentoo.org Subject: [gentoo-dev] [PATCH v3] eutils.eclass: Show death notice only when user patches were really applied Date: Tue, 23 Aug 2016 19:25:32 +0200 Message-Id: <20160823172532.63173-2-whissi@gentoo.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160823172532.63173-1-whissi@gentoo.org> References: <20160822172903.103838-1-whissi@gentoo.org> <20160823172532.63173-1-whissi@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Archives-Salt: cb3a3a97-720f-444f-9ee2-bb7a5952f99c X-Archives-Hash: 3523eb6c9a912414242876db8fc372f4 As part of the user requested feature from [Gentoo-Bug #543878] eutils.eclass shows a warning regarding user applied patches in case of an error [Link 1]. However this warning will always be shown even if no user patch were applied at all (example: empty /etc/portage// directory). This commit adds a new global variable "EPATCH_N_APPLIED_PATCHES" which tracks the number of applied user patches. This allows us to only show the notice when user patches were really applied. Link: https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/eutils.eclass?r1=1.443&r2=1.444 Gentoo-Bug: https://bugs.gentoo.org/543878 --- eclass/eutils.eclass | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index dbedffe..aaf195b 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -595,6 +595,8 @@ epatch() { : $(( count++ )) done + (( EPATCH_N_APPLIED_PATCHES++ )) + # if we had to decompress the patch, delete the temp one if [[ -n ${PIPE_CMD} ]] ; then rm -f "${PATCH_TARGET}" @@ -1736,13 +1738,17 @@ epatch_user() { [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${EPATCH_USER_SOURCE}/${CHOST}/${check} [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${EPATCH_USER_SOURCE}/${check} if [[ -d ${EPATCH_SOURCE} ]] ; then + local old_n_applied_patches=${EPATCH_N_APPLIED_PATCHES:-0} EPATCH_SOURCE=${EPATCH_SOURCE} \ EPATCH_SUFFIX="patch" \ EPATCH_FORCE="yes" \ EPATCH_MULTI_MSG="Applying user patches from ${EPATCH_SOURCE} ..." \ epatch echo "${EPATCH_SOURCE}" > "${applied}" - has epatch_user_death_notice ${EBUILD_DEATH_HOOKS} || EBUILD_DEATH_HOOKS+=" epatch_user_death_notice" + if [[ ${old_n_applied_patches} -lt ${EPATCH_N_APPLIED_PATCHES} ]]; then + has epatch_user_death_notice ${EBUILD_DEATH_HOOKS} || \ + EBUILD_DEATH_HOOKS+=" epatch_user_death_notice" + fi return 0 fi done -- 2.9.3