Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH 08/18] Add tentative support for EAPI6 eapply_user function
Date: Fri, 10 Feb 2017 13:57:15
Message-Id: 1486735022.1379.1.camel@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH 08/18] Add tentative support for EAPI6 eapply_user function by Zac Medico
1 W dniu 09.02.2017, czw o godzinie 14∶39 -0800, użytkownik Zac Medico
2 napisał:
3 > On 12/01/2014 01:28 PM, Michał Górny wrote:
4 > > Add support for the user patch applying function.
5 > > ---
6 > > bin/eapi.sh | 4 ++++
7 > > bin/phase-helpers.sh | 22 ++++++++++++++++++++++
8 > > 2 files changed, 26 insertions(+)
9 > >
10 > > diff --git a/bin/eapi.sh b/bin/eapi.sh
11 > > index 8ffffbb..6e78750 100644
12 > > --- a/bin/eapi.sh
13 > > +++ b/bin/eapi.sh
14 > > @@ -76,6 +76,10 @@ ___eapi_has_eapply() {
15 > > [[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
16 > > }
17 > >
18 > > +___eapi_has_eapply_user() {
19 > > + [[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
20 > > +}
21 > > +
22 > > ___eapi_has_master_repositories() {
23 > > [[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
24 > > }
25 > > diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
26 > > index e9fbbb4..f4b64ee 100644
27 > > --- a/bin/phase-helpers.sh
28 > > +++ b/bin/phase-helpers.sh
29 > > @@ -986,6 +986,28 @@ if ___eapi_has_eapply; then
30 > > }
31 > > fi
32 > >
33 > > +if ___eapi_has_eapply_user; then
34 > > + eapply_user() {
35 > > + local basedir=${PORTAGE_CONFIGROOT%/}/etc/portage/patches
36 > > +
37 > > + local d applied
38 > > + # possibilities:
39 > > + # 1. ${CATEGORY}/${P}-${PR} (note: -r0 desired to avoid applying
40 > > + # ${P} twice)
41 > > + # 2. ${CATEGORY}/${P}
42 > > + # 3. ${CATEGORY}/${PN}
43 > > + # all of the above may be optionally followed by a slot
44 > > + for d in "${basedir}"/${CATEGORY}/{${P}-${PR},${P},${PN}}{,:${SLOT%/*}}; do
45 > > + if [[ -d ${d} ]]; then
46 > > + eapply "${d}"
47 > > + applied=1
48 >
49 > I think it should break out of the loop here, like epatch_user does.
50
51 As the comment above suggests, it was intentional that all directories
52 are used.
53
54 > It doesn't make sense to apply more-specific patches before
55 > less-specific patches, does it?
56
57 Maybe. It would probably be most reasonable to sort them all by
58 filename, and apply in that order. Also allowing patch with the same
59 filename to override/skip patch from less specific directory.
60
61 > Maybe we can just treat this as a bug fix? Is anyone relying on the
62 > multiple directory usage?
63
64 That sounds like a major behavior change for a 'fix'. I'm using multiple
65 directories though it's all pretty much a workaround solution, so I
66 guess it doesn't matter if we keep it stable.
67
68 >
69 > > + fi
70 > > + done
71 > > +
72 > > + [[ -n ${applied} ]] && ewarn "User patches applied."
73 > > + }
74 > > +fi
75 > > +
76 > > if ___eapi_has_master_repositories; then
77 > > master_repositories() {
78 > > local output repository=$1 retval
79 > >
80 >
81 >
82
83 --
84 Best regards,
85 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies