Gentoo Archives: gentoo-dev

From: Ciaran McCreesh <ciaran.mccreesh@××××××××××.com>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] EAPI 3's default src_install needs bikeshedding
Date: Mon, 30 Mar 2009 16:10:20
Message-Id: 20090330171010.04d514e6@snowcone
1 So far, we've got this, by agreement of the Council:
2
3 * There will be a default src_install in EAPI 3
4 * It will have a DOCS variable, or something along those lines.
5
6 I'd like to suggest the following too:
7
8 * If DOCS is explicitly specified, it is an error if anything in it
9 doesn't exist.
10 * If DOCS isn't explicitly specified, it isn't an error if anything in
11 its default, if it has one, doesn't exist.
12
13 We don't have an implementation yet. So I'll start off with this:
14
15 default_src_install() {
16 emake -j1 DESTDIR="${D}" install
17
18 local d
19 if ! declare -p DOCS >/dev/null 2>&1 ; then
20 for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \
21 THANKS BUGS FAQ CREDITS CHANGELOG ; do
22 [[ -s "${d}" ]] && dodoc "${d}"
23 done
24 elif declare -p DOCS | grep -q '^declare -a ' ; then
25 for d in "${DOCS[@]}" ; do
26 dodoc "${d}"
27 done
28 else
29 dodoc ${DOCS}
30 fi
31 }
32
33 I got the default list by some horrid shell voodoo. Alternatively,
34 there's the following, which is a lot more comprehensive:
35
36 default_src_install() {
37 emake -j1 DESTDIR="${D}" install
38 emagicdocs
39 }
40
41 emagicdocs() {
42 done_docs=
43 old_set=$(shopt | grep 'nocaseglob[[:space:]]*on')
44 shopt -s nocaseglob
45 for d in '' "${DEFAULT_SRC_INSTALL_EXTRA_SUBDIRS[@]}" ; do
46 if [[ -n ${d} ]]; then
47 [[ -d ${d} ]] || die "${d} is not a dir"
48 pushd "${d}" > /dev/null || die "Failed to enter ${d}"
49 local docdesttree="${DOCDESTTREE}"
50 docinto "${d}"
51 fi
52 for f in README Change{,s,Log} AUTHORS NEWS TODO ABOUT THANKS {KNOWN_,}BUGS SUBMITTING \
53 HACKING FAQ CREDITS PKG-INFO HISTORY PACKAGING MAINTAINER{,S} CONTRIBUT{E,OR,ORS} RELEASE \
54 ANNOUNCE PORTING NOTES PROBLEMS NOTICE "${DEFAULT_SRC_INSTALL_EXTRA_DOCS[@]}"; do
55 for p in "${DEFAULT_SRC_INSTALL_EXTRA_PREFIXES[@]}" '' ; do
56 for doc in "${p}"*([[:digit:]])"${f}"{,+([._-])*} ; do
57 if [[ -s "${doc}" ]] ; then
58 for e in "${DEFAULT_SRC_INSTALL_EXCLUDE[@]}" ; do
59 [[ ${doc} == ${e} ]] && continue 2
60 done
61 done_docs="${done_docs} ${d%/}${d:+/}${doc}"
62 dodoc "${doc}"
63 fi
64 done
65 done
66 done
67 if [[ -n ${d} ]]; then
68 docinto "${docdesttree}"
69 popd > /dev/null || die "Failed to leave ${d}"
70 fi
71 done
72 if [[ -n "${done_docs}" ]] ; then
73 echo "Installed docs ${done_docs# }"
74 else
75 echo "Didn't find any docs to install"
76 fi
77 [[ -n ${old_set} ]] || shopt -u nocaseglob
78 }
79
80 --
81 Ciaran McCreesh

Attachments

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

Replies