1 |
Add support for the user patch applying function. |
2 |
--- |
3 |
bin/eapi.sh | 4 ++++ |
4 |
bin/phase-helpers.sh | 22 ++++++++++++++++++++++ |
5 |
2 files changed, 26 insertions(+) |
6 |
|
7 |
diff --git a/bin/eapi.sh b/bin/eapi.sh |
8 |
index 8ffffbb..6e78750 100644 |
9 |
--- a/bin/eapi.sh |
10 |
+++ b/bin/eapi.sh |
11 |
@@ -76,6 +76,10 @@ ___eapi_has_eapply() { |
12 |
[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]] |
13 |
} |
14 |
|
15 |
+___eapi_has_eapply_user() { |
16 |
+ [[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]] |
17 |
+} |
18 |
+ |
19 |
___eapi_has_master_repositories() { |
20 |
[[ ${1-${EAPI}} =~ ^(5-progress)$ ]] |
21 |
} |
22 |
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh |
23 |
index e9fbbb4..f4b64ee 100644 |
24 |
--- a/bin/phase-helpers.sh |
25 |
+++ b/bin/phase-helpers.sh |
26 |
@@ -986,6 +986,28 @@ if ___eapi_has_eapply; then |
27 |
} |
28 |
fi |
29 |
|
30 |
+if ___eapi_has_eapply_user; then |
31 |
+ eapply_user() { |
32 |
+ local basedir=${PORTAGE_CONFIGROOT%/}/etc/portage/patches |
33 |
+ |
34 |
+ local d applied |
35 |
+ # possibilities: |
36 |
+ # 1. ${CATEGORY}/${P}-${PR} (note: -r0 desired to avoid applying |
37 |
+ # ${P} twice) |
38 |
+ # 2. ${CATEGORY}/${P} |
39 |
+ # 3. ${CATEGORY}/${PN} |
40 |
+ # all of the above may be optionally followed by a slot |
41 |
+ for d in "${basedir}"/${CATEGORY}/{${P}-${PR},${P},${PN}}{,:${SLOT%/*}}; do |
42 |
+ if [[ -d ${d} ]]; then |
43 |
+ eapply "${d}" |
44 |
+ applied=1 |
45 |
+ fi |
46 |
+ done |
47 |
+ |
48 |
+ [[ -n ${applied} ]] && ewarn "User patches applied." |
49 |
+ } |
50 |
+fi |
51 |
+ |
52 |
if ___eapi_has_master_repositories; then |
53 |
master_repositories() { |
54 |
local output repository=$1 retval |
55 |
-- |
56 |
2.1.3 |