summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2016-08-31 18:39:57 +0200
committerThomas Deutschmann <whissi@gentoo.org>2016-08-31 18:39:57 +0200
commitf7d866b62b7040b98e1bd81257f506dbc417672f (patch)
tree9b63f0846fd6946c5edede9809bb466d418122b1 /eclass
parentnet-analyzer/scapy: Add live ebuild. (diff)
downloadgentoo-f7d866b62b7040b98e1bd81257f506dbc417672f.tar.gz
gentoo-f7d866b62b7040b98e1bd81257f506dbc417672f.tar.bz2
gentoo-f7d866b62b7040b98e1bd81257f506dbc417672f.zip
eutils.eclass: Show death notice only when user patches were really applied
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/<cat>/<pkg> 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
Diffstat (limited to 'eclass')
-rw-r--r--eclass/eutils.eclass8
1 files changed, 7 insertions, 1 deletions
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
index dbedffe01d4a..aaf195b43c98 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