1 |
commit: f7d866b62b7040b98e1bd81257f506dbc417672f |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Aug 31 16:39:57 2016 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Aug 31 16:39:57 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f7d866b6 |
7 |
|
8 |
eutils.eclass: Show death notice only when user patches were really applied |
9 |
|
10 |
As part of the user requested feature from [Gentoo-Bug #543878] |
11 |
eutils.eclass shows a warning regarding user applied patches in case of an |
12 |
error [Link 1]. |
13 |
|
14 |
However this warning will always be shown even if no user patch were |
15 |
applied at all (example: empty /etc/portage/<cat>/<pkg> directory). |
16 |
|
17 |
This commit adds a new global variable "EPATCH_N_APPLIED_PATCHES" which |
18 |
tracks the number of applied user patches. This allows us to only show the |
19 |
notice when user patches were really applied. |
20 |
|
21 |
Link: https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/eutils.eclass?r1=1.443&r2=1.444 |
22 |
|
23 |
Gentoo-Bug: https://bugs.gentoo.org/543878 |
24 |
|
25 |
eclass/eutils.eclass | 8 +++++++- |
26 |
1 file changed, 7 insertions(+), 1 deletion(-) |
27 |
|
28 |
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass |
29 |
index dbedffe..aaf195b 100644 |
30 |
--- a/eclass/eutils.eclass |
31 |
+++ b/eclass/eutils.eclass |
32 |
@@ -595,6 +595,8 @@ epatch() { |
33 |
: $(( count++ )) |
34 |
done |
35 |
|
36 |
+ (( EPATCH_N_APPLIED_PATCHES++ )) |
37 |
+ |
38 |
# if we had to decompress the patch, delete the temp one |
39 |
if [[ -n ${PIPE_CMD} ]] ; then |
40 |
rm -f "${PATCH_TARGET}" |
41 |
@@ -1736,13 +1738,17 @@ epatch_user() { |
42 |
[[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${EPATCH_USER_SOURCE}/${CHOST}/${check} |
43 |
[[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${EPATCH_USER_SOURCE}/${check} |
44 |
if [[ -d ${EPATCH_SOURCE} ]] ; then |
45 |
+ local old_n_applied_patches=${EPATCH_N_APPLIED_PATCHES:-0} |
46 |
EPATCH_SOURCE=${EPATCH_SOURCE} \ |
47 |
EPATCH_SUFFIX="patch" \ |
48 |
EPATCH_FORCE="yes" \ |
49 |
EPATCH_MULTI_MSG="Applying user patches from ${EPATCH_SOURCE} ..." \ |
50 |
epatch |
51 |
echo "${EPATCH_SOURCE}" > "${applied}" |
52 |
- has epatch_user_death_notice ${EBUILD_DEATH_HOOKS} || EBUILD_DEATH_HOOKS+=" epatch_user_death_notice" |
53 |
+ if [[ ${old_n_applied_patches} -lt ${EPATCH_N_APPLIED_PATCHES} ]]; then |
54 |
+ has epatch_user_death_notice ${EBUILD_DEATH_HOOKS} || \ |
55 |
+ EBUILD_DEATH_HOOKS+=" epatch_user_death_notice" |
56 |
+ fi |
57 |
return 0 |
58 |
fi |
59 |
done |