Gentoo Logo
Gentoo Spaceship

Installation:
Gentoo Handbook
Installation Docs

Documentation:
Home
Listing
About Gentoo
Philosophy
Social Contract

Resources:
Bug Tracker
Developer List
Discussion Forums
Gentoo BitTorrents
Gentoo Linux Enhancement Proposals
IRC Channels
Mailing Lists
Mirrors
Name and Logo Guidelines
Online Package Database
Security Announcements
Staffing Needs
Supporting Vendors
View our CVS

Graphics:
Logos and themes
Icons
ScreenShots

Miscellaneous Resources:
Gentoo Linux Store
Gentoo-hosted projects
IBM dW/Intel article archive




List Archive: gentoo-devhelp
Navigation:
Lists: gentoo-devhelp: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-devhelp@g.o
From: Mike Frysinger <vapier@g.o>
Subject: Re: Re: Calling the default implementation of a function
Date: Sun, 1 Nov 2009 16:03:46 -0400
On Sunday 01 November 2009 14:34:04 Nikos Chantziaras wrote:
> On 10/31/2009 11:37 PM, Mike Frysinger wrote:
> > On Saturday 31 October 2009 11:47:54 Nikos Chantziaras wrote:
> >> Is there a way to call the default implementation of a function inside
> >> the ebuild-specified one?
> >>
> >> What I mean is:
> >>
> >> src_prepare() {
> >> 	if [ "$PV" == "9999" ]; then
> >> 		./autogen.sh
> >> 	else
> >> 		src_prepare() # Default from eclass.
> >> 	fi
> >> }
> >>
> >> Possible?
> >
> > better to wrap the func definition:
> > if [[ ${PV} == "9999" ]] ; then
> > src_prepare() { eautoreconf; }
> > fi
> 
> /usr/local/portage/app-misc/mc/mc-9999.ebuild: line 49: syntax error
> near unexpected token `fi'
> /usr/local/portage/app-misc/mc/mc-9999.ebuild: line 49: `fi'
>   * ERROR: app-misc/mc-9999 failed:
>   *   error sourcing ebuild

works fine for me.  either you copied it wrong, or your ebuild has an error in 
it unrelated to this, or you're using a bash version older than stable which 
has a parsing bug and thus i dont care ;).
-mike
Attachment:
signature.asc (This is a digitally signed message part.)
Replies:
Re: Re: Calling the default implementation of a function
-- Nikos Chantziaras
References:
Calling the default implementation of a function
-- Nikos Chantziaras
Re: Calling the default implementation of a function
-- Mike Frysinger
Re: Calling the default implementation of a function
-- Nikos Chantziaras
Navigation:
Lists: gentoo-devhelp: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: Calling the default implementation of a function
Next by thread:
Re: Re: Calling the default implementation of a function
Previous by date:
Re: Calling the default implementation of a function
Next by date:
Re: Re: Calling the default implementation of a function


Updated Nov 16, 2009

Donate to support our development efforts.

Gentoo Centric Hosting: vr.org

VR Hosted

Tek Alchemy

Tek Alchemy

SevenL.net

SevenL.net

php|architect

php|architect

Copyright 2001-2007 Gentoo Foundation, Inc. Questions, Comments? Email www@gentoo.org.