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-dev
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-dev@g.o
From: "Nirbheek Chauhan" <nirbheek.chauhan@...>
Subject: Re: Re: Default src_install for EAPI-2 or following EAPI
Date: Wed, 24 Sep 2008 13:16:29 +0530
On Wed, Sep 24, 2008 at 4:51 AM, Bo Ørsted Andresen <bo.andresen@...> wrote:
> On Tuesday 23 September 2008 21:39:52 Thomas Sachau wrote:
>> default_src_install() {
>>         if [ -f Makefile -o -f GNUmakefile -o -f makefile ]; then
>>                 if emake DESTDIR="${D} install || einstall ; then
>>                         die "install failed"
>>                 else
>>                         if [[ -n ${DOCS} ]]; then
>>                                 dodoc ${DOCS} || die "dodoc failed"
>>                         fi
>>                 fi
>>         fi
>> }
>>
>> Any more comments? Good? Bad? Interested?
>
> Now figure out the four flaws in the above code.

Even though IMO that comment is quite condescending, I'll list out the
flaws in that code:

>>         if [ -f Makefile -o -f GNUmakefile -o -f makefile ]; then
[...]
>>         fi

- So if those makefiles don't exist, the package should just carry on
without installing anything?

>>                 if emake DESTDIR="${D} install || einstall ; then
>>                         die "install failed"

- It is quite useless to run *both* emake install and einstall.
Default are not supposed to be lazy-maintainer-proof. The maintainer
should make sure that the ebuild works with emake install, and *if* it
doesn't, use einstall
- The above code will cause a die when either one of emake install or
einstall are *successful*. The opposite behaviour is desired.

>>                 else
>>                         if [[ -n ${DOCS} ]]; then
>>                                 dodoc ${DOCS} || die "dodoc failed"
>>                         fi

- So, if emake install || einstall fails, one should just install the
docs? The opposite behaviour is desired.

If a default src_install is desired, it should cater to the most
common use-cases and leave it to the maintainer to override it if
desired.

default_src_install() {
    emake DESTDIR="${D}" install || die "emake install failed"
    if [ -n "${DOCS}" ]; then
        dodoc ${DOCS} || die "dodoc failed"
    else
        # No die here because we don't know if any of these exist
        dodoc AUTHORS ChangeLog NEWS README
    fi
}

-- 
~Nirbheek Chauhan


Replies:
Re: Re: Default src_install for EAPI-2 or following EAPI
-- Thomas Sachau
References:
Re: Default src_install for EAPI-2 or following EAPI
-- Ulrich Mueller
Re: Re: Default src_install for EAPI-2 or following EAPI
-- Thomas Sachau
Re: Re: Default src_install for EAPI-2 or following EAPI
-- Bo Ørsted Andresen
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: Re: Default src_install for EAPI-2 or following EAPI
Next by thread:
Re: Re: Default src_install for EAPI-2 or following EAPI
Previous by date:
Re: [project] Re: Default src_install for EAPI-2 or following EAPI
Next by date:
Re: Re: Default src_install for EAPI-2 or following EAPI


Updated Jun 17, 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.