Gentoo Archives: gentoo-devhelp

From: Nikos Chantziaras <realnc@×××××.de>
To: Mike Frysinger <vapier@g.o>
Cc: gentoo-devhelp@l.g.o
Subject: Re: [gentoo-devhelp] Re: Calling the default implementation of a function
Date: Sun, 01 Nov 2009 20:17:06
Message-Id: 4AEDECC4.4080505@arcor.de
In Reply to: Re: [gentoo-devhelp] Re: Calling the default implementation of a function by Mike Frysinger
1 On 11/01/2009 10:03 PM, Mike Frysinger wrote:
2 > On Sunday 01 November 2009 14:34:04 Nikos Chantziaras wrote:
3 >> On 10/31/2009 11:37 PM, Mike Frysinger wrote:
4 >>> On Saturday 31 October 2009 11:47:54 Nikos Chantziaras wrote:
5 >>>> Is there a way to call the default implementation of a function inside
6 >>>> the ebuild-specified one?
7 >>>>
8 >>>> What I mean is:
9 >>>>
10 >>>> src_prepare() {
11 >>>> if [ "$PV" == "9999" ]; then
12 >>>> ./autogen.sh
13 >>>> else
14 >>>> src_prepare() # Default from eclass.
15 >>>> fi
16 >>>> }
17 >>>>
18 >>>> Possible?
19 >>>
20 >>> better to wrap the func definition:
21 >>> if [[ ${PV} == "9999" ]] ; then
22 >>> src_prepare() { eautoreconf; }
23 >>> fi
24 >>
25 >> /usr/local/portage/app-misc/mc/mc-9999.ebuild: line 49: syntax error
26 >> near unexpected token `fi'
27 >> /usr/local/portage/app-misc/mc/mc-9999.ebuild: line 49: `fi'
28 >> * ERROR: app-misc/mc-9999 failed:
29 >> * error sourcing ebuild
30 >
31 > works fine for me. either you copied it wrong, or your ebuild has an error in
32 > it unrelated to this, or you're using a bash version older than stable which
33 > has a parsing bug and thus i dont care ;).
34 > -mike
35
36 Correct, I forgot the semicolon after ./autogen.sh. Thanks for this
37 tip, didn't know it was possible (I'm not that fluid in Bash, my mind is
38 too much C-oriented :P)