1 |
On 12/01/2014 01:28 PM, Michał Górny wrote: |
2 |
> Add support for the user patch applying function. |
3 |
> --- |
4 |
> bin/eapi.sh | 4 ++++ |
5 |
> bin/phase-helpers.sh | 22 ++++++++++++++++++++++ |
6 |
> 2 files changed, 26 insertions(+) |
7 |
> |
8 |
> diff --git a/bin/eapi.sh b/bin/eapi.sh |
9 |
> index 8ffffbb..6e78750 100644 |
10 |
> --- a/bin/eapi.sh |
11 |
> +++ b/bin/eapi.sh |
12 |
> @@ -76,6 +76,10 @@ ___eapi_has_eapply() { |
13 |
> [[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]] |
14 |
> } |
15 |
> |
16 |
> +___eapi_has_eapply_user() { |
17 |
> + [[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]] |
18 |
> +} |
19 |
> + |
20 |
> ___eapi_has_master_repositories() { |
21 |
> [[ ${1-${EAPI}} =~ ^(5-progress)$ ]] |
22 |
> } |
23 |
> diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh |
24 |
> index e9fbbb4..f4b64ee 100644 |
25 |
> --- a/bin/phase-helpers.sh |
26 |
> +++ b/bin/phase-helpers.sh |
27 |
> @@ -986,6 +986,28 @@ if ___eapi_has_eapply; then |
28 |
> } |
29 |
> fi |
30 |
> |
31 |
> +if ___eapi_has_eapply_user; then |
32 |
> + eapply_user() { |
33 |
> + local basedir=${PORTAGE_CONFIGROOT%/}/etc/portage/patches |
34 |
> + |
35 |
> + local d applied |
36 |
> + # possibilities: |
37 |
> + # 1. ${CATEGORY}/${P}-${PR} (note: -r0 desired to avoid applying |
38 |
> + # ${P} twice) |
39 |
> + # 2. ${CATEGORY}/${P} |
40 |
> + # 3. ${CATEGORY}/${PN} |
41 |
> + # all of the above may be optionally followed by a slot |
42 |
> + for d in "${basedir}"/${CATEGORY}/{${P}-${PR},${P},${PN}}{,:${SLOT%/*}}; do |
43 |
> + if [[ -d ${d} ]]; then |
44 |
> + eapply "${d}" |
45 |
> + applied=1 |
46 |
|
47 |
I think it should break out of the loop here, like epatch_user does. |
48 |
|
49 |
It doesn't make sense to apply more-specific patches before |
50 |
less-specific patches, does it? |
51 |
|
52 |
Maybe we can just treat this as a bug fix? Is anyone relying on the |
53 |
multiple directory usage? |
54 |
|
55 |
> + fi |
56 |
> + done |
57 |
> + |
58 |
> + [[ -n ${applied} ]] && ewarn "User patches applied." |
59 |
> + } |
60 |
> +fi |
61 |
> + |
62 |
> if ___eapi_has_master_repositories; then |
63 |
> master_repositories() { |
64 |
> local output repository=$1 retval |
65 |
> |
66 |
|
67 |
|
68 |
-- |
69 |
Thanks, |
70 |
Zac |