Skip to content

Commit

Permalink
Add tentative support for EAPI6 eapply_user function
Browse files Browse the repository at this point in the history
Add support for the user patch applying function.
  • Loading branch information
mgorny committed Sep 4, 2014
1 parent 5fa6f6a commit 1083b54
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/eapi.sh
Expand Up @@ -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)$ ]]
}
Expand Down
22 changes: 22 additions & 0 deletions bin/phase-helpers.sh
Expand Up @@ -943,6 +943,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
Expand Down

0 comments on commit 1083b54

Please sign in to comment.