Gentoo Archives: gentoo-dev

From: Thomas Sachau <tommy@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Default src_install for EAPI-2 or following EAPI
Date: Sun, 05 Oct 2008 17:58:30
Message-Id: 48E90032.3080308@gentoo.org
In Reply to: Re: [gentoo-dev] Default src_install for EAPI-2 or following EAPI by Robert Buchholz
1 Robert Buchholz schrieb:
2 > On Sunday, 5. October 2008, Ulrich Mueller wrote:
3 >>>>>>> On Sun, 5 Oct 2008, Robert Buchholz wrote:
4 >>>>> It's not. If you want to have default DOCS then you should loop
5 >>>>> through the items and check with [[ -e ]] before trying to
6 >>>>> install them.
7 >>>> So, maybe just do a 'dodoc "${DOCS}"' and omit the die? Then it won't
8 >>>> fail but the warning message would be preserved.
9 >>> I understood Petteri's comment to be related to the default case
10 >>> (i.e. the else-branch), and I have to agree there: Ebuilds that do
11 >>> not override src_install should not emit a warning when some
12 >>> ChangeLog file is missing that the ebuild never specified to
13 >>> install.
14 >> The default would be an empty DOCS variable, or did I miss something?
15 >
16 > Correct.
17 >
18 >> So if the ebuild includes non-existing files in DOCS, then why would
19 >> you want to suppress the warnings?
20 >
21 > I don't. My point was that the default action on an empty DOCS variable is
22 > to "dodoc AUTHORS ChangeLog NEWS README", and this should not emit
23 > warnings, because it is merely a heuristic.
24 >
25 > To be clearer:
26 > else
27 > - # No die here because we don't know if any of these exist
28 > - dodoc AUTHORS ChangeLog NEWS README
29 > + for x in AUTHORS ChangeLog NEWS README; do
30 > + if [ -e ${x} ]; then
31 > + dodoc ${x} || die "dodoc ${x} failed"
32 > + fi
33 > + done
34 > fi
35 >
36 >
37 > Robert
38
39 So what about this funcion for the next EAPI and also implementation in base.eclass?
40
41 default_src_install() {
42 if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
43 emake DESTDIR="${D}" install || die "emake install failed"
44 fi
45 if [ -n "${DOCS}" ]; then
46 dodoc ${DOCS} || die "dodoc failed"
47 else
48 for x in AUTHORS ChangeLog NEWS README; do
49 if [ -e ${x} ]; then
50 dodoc ${x} || die "dodoc ${x} failed"
51 fi
52 done
53 fi
54 }
55
56 --
57 Thomas Sachau
58
59 Gentoo Linux Developer

Attachments

File name MIME type
signature.asc application/pgp-signature