apache-2.eclass: Handle PATCHES array. Added epatch_user.
authorLars Wendler <polynomial-c@gentoo.org>
Wed, 2 Nov 2016 14:35:34 +0000 (15:35 +0100)
committerLars Wendler <polynomial-c@gentoo.org>
Wed, 2 Nov 2016 14:39:12 +0000 (15:39 +0100)
eclass/apache-2.eclass

index 3f9e706f8b933791bba99c7c932f4acc62547927..a8d5804af61c1cc579caef443d74dd7a387b274e 100644 (file)
@@ -23,7 +23,7 @@ case ${EAPI:-0} in
                :;
        ;;
        6)
-               die "This eclass is not yet ready for EAPI-6"
+               die "This eclass is not yet ready for EAPI-6. Please help porting it!"
        ;;
 esac
 
@@ -453,6 +453,20 @@ apache-2_src_prepare() {
 
        epatch "${GENTOO_PATCHDIR}"/patches/*.patch
 
+       if [[ ${EAPI} = 5 ]] ; then
+               # Handle patches from ebuild's PATCHES array if one is given
+               if [[ -n "${PATCHES}" ]] ; then
+                       local patchestype=$(declare -p PATCHES 2>&-)
+                       if [[ "${patchestype}" != "declare -a PATCHES="* ]] ; then
+                               die "Declaring PATCHES as a variable is forbidden. Please use an array instead."
+                       fi
+                       epatch "${PATCHES[@]}"
+               fi
+
+               # Handle user patches
+               epatch_user
+       fi
+
        # setup the filesystem layout config
        cat "${GENTOO_PATCHDIR}"/patches/config.layout >> "${S}"/config.layout || \
                die "Failed preparing config.layout!"