diff options
author | Michał Górny <mgorny@gentoo.org> | 2014-08-17 23:52:42 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2014-12-04 15:01:35 +0100 |
commit | f188c989317a58ffc54cc0c022c728c100de9000 (patch) | |
tree | 4543efc18618b9d7a60e316284669b483b45b2a0 | |
parent | Add tentative support for EAPI6 eapply function (diff) | |
download | portage-f188c989317a58ffc54cc0c022c728c100de9000.tar.gz portage-f188c989317a58ffc54cc0c022c728c100de9000.tar.bz2 portage-f188c989317a58ffc54cc0c022c728c100de9000.zip |
Add tentative support for EAPI6 eapply_user function
Add support for the user patch applying function.
-rw-r--r-- | bin/eapi.sh | 4 | ||||
-rw-r--r-- | bin/phase-helpers.sh | 22 |
2 files changed, 26 insertions, 0 deletions
diff --git a/bin/eapi.sh b/bin/eapi.sh index 8ffffbba0..6e787508c 100644 --- a/bin/eapi.sh +++ b/bin/eapi.sh @@ -76,6 +76,10 @@ ___eapi_has_eapply() { [[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]] } +___eapi_has_eapply_user() { + [[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]] +} + ___eapi_has_master_repositories() { [[ ${1-${EAPI}} =~ ^(5-progress)$ ]] } diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh index e9fbbb451..f4b64eeeb 100644 --- a/bin/phase-helpers.sh +++ b/bin/phase-helpers.sh @@ -986,6 +986,28 @@ if ___eapi_has_eapply; then } fi +if ___eapi_has_eapply_user; then + eapply_user() { + local basedir=${PORTAGE_CONFIGROOT%/}/etc/portage/patches + + local d applied + # possibilities: + # 1. ${CATEGORY}/${P}-${PR} (note: -r0 desired to avoid applying + # ${P} twice) + # 2. ${CATEGORY}/${P} + # 3. ${CATEGORY}/${PN} + # all of the above may be optionally followed by a slot + for d in "${basedir}"/${CATEGORY}/{${P}-${PR},${P},${PN}}{,:${SLOT%/*}}; do + if [[ -d ${d} ]]; then + eapply "${d}" + applied=1 + fi + done + + [[ -n ${applied} ]] && ewarn "User patches applied." + } +fi + if ___eapi_has_master_repositories; then master_repositories() { local output repository=$1 retval |