From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-dev+bounces-32871-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1KiP4y-0001dH-Hv
	for garchives@archives.gentoo.org; Wed, 24 Sep 2008 07:46:32 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 89BB9E07AA;
	Wed, 24 Sep 2008 07:46:31 +0000 (UTC)
Received: from ti-out-0910.google.com (ti-out-0910.google.com [209.85.142.191])
	by pigeon.gentoo.org (Postfix) with ESMTP id 16583E07AA
	for <gentoo-dev@lists.gentoo.org>; Wed, 24 Sep 2008 07:46:30 +0000 (UTC)
Received: by ti-out-0910.google.com with SMTP id u5so1695961tia.10
        for <gentoo-dev@lists.gentoo.org>; Wed, 24 Sep 2008 00:46:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:message-id:date:from:to
         :subject:in-reply-to:mime-version:content-type
         :content-transfer-encoding:content-disposition:references;
        bh=a+cEF1ZEU5Lyp+okZDhn9aIzOXE5iNs0wW1IF8cnLfY=;
        b=RzhcqsgSIF8Q3bf0Pu6zn+9oLKrqv1aQzUahFuMip5UwLEBhhA6MRhSVaWIyy4YQxz
         N+3TfNVYvT5ofQ8IbCWp95iwpytTZwOqiRoL7HhLepR1rASzcYftXpJK6Ma3RH0rQEwq
         NMvvwAvOLxZntzLCXm0/Sz1EetNr6eEBJ7GhE=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=message-id:date:from:to:subject:in-reply-to:mime-version
         :content-type:content-transfer-encoding:content-disposition
         :references;
        b=FHMvvETvTcNBxTrZhmfQWfsNNZg5WVHxbdbSMH121ZsA0X/zZsLxVTaZBHdsYlUzcc
         aHru7Nm5Zxk/CI5Jyx6WII0EqHZzbPQuTnMh3b64f+hzm/6rRLsVhvHz8EbJ737EXjH/
         oXH1ojkrVZFf1qeI+zkyCG4VA7hZHuq41mBNQ=
Received: by 10.110.46.3 with SMTP id t3mr8876349tit.30.1222242389215;
        Wed, 24 Sep 2008 00:46:29 -0700 (PDT)
Received: by 10.110.17.2 with HTTP; Wed, 24 Sep 2008 00:46:29 -0700 (PDT)
Message-ID: <8b4c83ad0809240046n20adbeb1gb376db13d79f7bdc@mail.gmail.com>
Date: Wed, 24 Sep 2008 13:16:29 +0530
From: "Nirbheek Chauhan" <nirbheek.chauhan@gmail.com>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] Re: Default src_install for EAPI-2 or following EAPI
In-Reply-To: <200809240121.04326.bo.andresen@zlin.dk>
Precedence: bulk
List-Post: <mailto:gentoo-dev@lists.gentoo.org>
List-Help: <mailto:gentoo-dev+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-dev+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-dev+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-dev.gentoo.org>
X-BeenThere: gentoo-dev@lists.gentoo.org
Reply-to: gentoo-dev@lists.gentoo.org
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
References: <bcwiO-7zO-1@gated-at.bofh.it>
	 <18646.45711.173931.589892@a1ihome1.kph.uni-mainz.de>
	 <48D94608.7060805@gentoo.org> <200809240121.04326.bo.andresen@zlin.dk>
X-Archives-Salt: e92dd82c-463c-491c-b996-9a925faff625
X-Archives-Hash: 00ace2fc10eac089b8df97d270ec7f50

On Wed, Sep 24, 2008 at 4:51 AM, Bo =D8rsted Andresen <bo.andresen@zlin.dk>=
 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=3D"${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=3D"${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=3D"${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
}

--=20
~Nirbheek Chauhan