x-modular.eclass: A modified approach to EAPI support
I decided to try something a little different because I had some ideas
for improving the existing EAPI patches I've seen going into other
eclasses. So here is my patch for x-modular.eclass. I tested it with
ebuilds using EAPIs 0, 1, and 2, and it appeared to work fine. It
already happened to have a function called src_configure, so that
doesn't appear in the patch.
One thing I see as an improvement is a lack of EAPI value checks
throughout the ebuild to avoid repetition between the function export
and the function call. Things just check whether a function was
exported, which is the only place where EAPI value checks happen.
Additionally, the fallback in case statements is "I don't know what to
do" and supported EAPIs are explicitly defined. This will make it
obvious when the eclass doesn't support a new EAPI instead of it
randomly failing after you try it.
Developer, Gentoo Linux
--- /home/donnie/src/gentoo-x86/eclass/x-modular.eclass 2009-03-06 12:11:38.000000000 -0800
+++ x-modular.eclass 2009-03-06 12:16:25.000000000 -0800
@@ -26,6 +26,21 @@
# there. You may also want to change the SLOT.