Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo Development (http://www.linux-archive.org/gentoo-development/)
-   -   x-modular.eclass: A modified approach to EAPI support (http://www.linux-archive.org/gentoo-development/258962-x-modular-eclass-modified-approach-eapi-support.html)

Donnie Berkholz 03-08-2009 04:22 AM

x-modular.eclass: A modified approach to EAPI support
 
On 12:57 Fri 06 Mar , Donnie Berkholz wrote:
> 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.

FYI, using EXPORT_FUNCTIONS before inherit, as this patch caused
x-modular.eclass to do, is broken in current portage releases. Zac said
he would change this to be consistent with the lack of any ordering
restriction in the PMS. Thanks to Tomáš Chvátal for tracking down this
tricky bug!

I ran a quick check across everything in the tree and was happy to see
nothing doing this besides my eclass patch. Here's the scriptlet I used:

for i in /usr/portage/eclass/*; do
grep -q EXPORT_FUNCTIONS $i || continue
grep -q inherit $i || continue
LINE1=$(grep -n EXPORT_FUNCTIONS $i | grep -v ':#' | cut -d: -f1 | head -n1)
LINE2=$(grep -n inherit $i | grep -v ':#' | cut -d: -f1 | tail -n1)
if [[ $LINE1 -lt $LINE2 ]]; then
echo $i $LINE1 $LINE2
fi
done

Manual checking of the two results showed false positives.

--
Thanks,
Donnie

Donnie Berkholz
Developer, Gentoo Linux
Blog: http://dberkholz.wordpress.com


All times are GMT. The time now is 09:26 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.