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 ) id 1Kh1S4-0001XN-T1 for garchives@archives.gentoo.org; Sat, 20 Sep 2008 12:20:41 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 21CC2E0202; Sat, 20 Sep 2008 12:20:40 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id EE6B1E0202 for ; Sat, 20 Sep 2008 12:20:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id C196467454 for ; Sat, 20 Sep 2008 12:20:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at gentoo.org X-Spam-Score: -0.69 X-Spam-Level: X-Spam-Status: No, score=-0.69 required=5.5 tests=[AWL=0.841, BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1, RCVD_NUMERIC_HELO=2.067, WEIRD_PORT=0.001] Received: from smtp.gentoo.org ([127.0.0.1]) by localhost (smtp.gentoo.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FHVPVj7yOYKW for ; Sat, 20 Sep 2008 12:20:32 +0000 (UTC) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id F113267B39 for ; Sat, 20 Sep 2008 12:20:29 +0000 (UTC) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Kh1Rp-0007Qi-V3 for gentoo-dev@gentoo.org; Sat, 20 Sep 2008 12:20:26 +0000 Received: from 91.84.123.143 ([91.84.123.143]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 20 Sep 2008 12:20:25 +0000 Received: from slong by 91.84.123.143 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 20 Sep 2008 12:20:25 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: gentoo-dev@lists.gentoo.org From: Steve Long Subject: [gentoo-dev] Re: Default src_install for EAPI-2 or following EAPI Date: Sat, 20 Sep 2008 13:12:21 +0100 Message-ID: References: <20080916000101.GJ6035@curie-int.orbis-terrarum.net> <48D4DEF8.10202@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 91.84.123.143 User-Agent: KNode/0.10.9 Sender: news X-Archives-Salt: 328a7274-ff54-4cb7-b3da-041bda81fdae X-Archives-Hash: eaeb62cbaabbba814d3cf5685cb13107 Thomas Sachau wrote: > I see, we have a default src_unpack and a default src_compile but a > default src_install is still missing. Here is my suggestion (taken and > modified from bug 33544): > > src_install() { > if [ -f Makefile -o -f GNUmakefile -o -f makefile ]; then > emake DESTDIR=${D} install || die "emake install failed" You need to quote $D there, eg: DESTDIR="$D" as it's a parameter to a command there, not a temporary export (as: DESTDIR=$D emake.. would be.) > [[ -n ${DOCS} ]] && dodoc ${DOCS} > else > einstall || die "einstall failed" > [[ -n ${DOCS} ]] && dodoc ${DOCS} > fi > } > > Any comments? It might be wise to use an array for DOCS there, so that filenames with spaces are dealt with correctly. (I'm thinking of all those lovely GUI apps.) To keep compatibility with space-separated values, I use this function: isArr() [[ $(declare -p "$1" 2>/dev/null) = 'declare -a'* ]] (Yes I know, it's fugly.) So this kinda logic deals with both: if isArr DOCS; then ((${#DOCS[@]})) && dodoc "${DOCS[@]}" else [[ $DOCS ]] && dodoc $DOCS fi (There's no need to repeat it, just move it to after the previous if.) That can easily be initialised with a glob, eg DOCS=("$S"/doc/*) (although I recommend nullglob if doing so.) [See http://wooledge.org:8000/BashFAQ/073 (half way down) if you need to strip prefixes or the like.]