aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/e/ebuild
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2015-11-05 17:35:15 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2015-11-05 17:37:29 +0000
commit53f810cb0be8b63a682770a96ada8695f1beef69 (patch)
treeb3fa81c7fdaf27359c3bdddf4419341f38561f05 /paludis/repositories/e/ebuild
parente7180b72c432d32b4c7324dea4ae859084ac08ea (diff)
downloadpaludis-53f810cb0be8b63a682770a96ada8695f1beef69.tar.gz
paludis-53f810cb0be8b63a682770a96ada8695f1beef69.tar.xz
EAPI 6 has eapply
Diffstat (limited to 'paludis/repositories/e/ebuild')
-rw-r--r--paludis/repositories/e/ebuild/6/build_functions.bash54
1 files changed, 54 insertions, 0 deletions
diff --git a/paludis/repositories/e/ebuild/6/build_functions.bash b/paludis/repositories/e/ebuild/6/build_functions.bash
index ede818959..8420a36d7 100644
--- a/paludis/repositories/e/ebuild/6/build_functions.bash
+++ b/paludis/repositories/e/ebuild/6/build_functions.bash
@@ -19,6 +19,60 @@
ebuild_load_module --older build_functions
+eapply()
+{
+ local -a options files
+ local p dashdash= badmix=
+ for p in "${@}" ; do
+ if [[ -n ${dashdash} ]] ; then
+ files+=( "${p}" )
+ elif [[ ${p} == -- ]] ; then
+ options+=( "${files[@]}" )
+ files=( )
+ dashdash=yes
+ elif [[ ${p} == -* && ${#files[@]} -eq 0 ]] ; then
+ options+=( "${p}" )
+ else
+ [[ ${p} == -* ]] && badmix=yes
+ files+=( "${p}" )
+ fi
+ done
+
+ [[ -z ${dashdash} && -n ${badmix} ]] && die "options must be specified before patches"
+ [[ ${#files[@]} -eq 0 ]] && die "no patches specified"
+
+ local x st
+ for x in "${files[@]}" ; do
+ if [[ -d ${x} ]] ; then
+ local f any=
+
+ for f in "${x}"/*.@(diff|patch) ; do
+ [[ -e ${f} ]] || continue
+ any=yes
+ patch -p1 -f -g0 --no-backup-if-mismatch "${options[@]}" < "${f}"
+ st=${?}
+ if [[ ${st} -ne 0 ]] ; then
+ paludis_die_unless_nonfatal "applying patch ${f} failed"
+ return ${st}
+ fi
+ done
+
+ [[ -z ${any} ]] && die "no patches found in directory ${x}"
+
+ else
+ patch -p1 -f -g0 --no-backup-if-mismatch "${options[@]}" < "${x}"
+ st=${?}
+ if [[ ${st} -ne 0 ]] ; then
+ paludis_die_unless_nonfatal "applying patch ${x} failed"
+ return ${st}
+ fi
+ fi
+ done
+
+ return 0
+}
+ebuild_need_extglob eapply
+
einstall()
{
die "einstall is banned in EAPI 6"