Gentoo Archives: gentoo-commits

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Mon, 09 Sep 2019 08:22:17
Message-Id: 1568016641.8a9982a334c2028211d7eee1700a3dfe4199463d.ulm@gentoo
1 commit: 8a9982a334c2028211d7eee1700a3dfe4199463d
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 5 10:33:48 2019 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 9 08:10:41 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8a9982a3
7
8 elisp.eclass: Use EAPI defaults where possible.
9
10 src_unpack: Call default instead of explicit unpack.
11 src_prepare: Call default, so that the PATCHES variable will be
12 respected in EAPIs 6 and 7.
13 src_install: Call einstalldocs in EAPIs where it is supported.
14
15 Drop unnecessary die statements, because helpers die by themselves
16 in all supported EAPIs.
17
18 Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
19
20 eclass/elisp.eclass | 25 +++++++++++--------------
21 1 file changed, 11 insertions(+), 14 deletions(-)
22
23 diff --git a/eclass/elisp.eclass b/eclass/elisp.eclass
24 index c885345a7a8..bcd80a9ee9c 100644
25 --- a/eclass/elisp.eclass
26 +++ b/eclass/elisp.eclass
27 @@ -38,7 +38,8 @@
28 # @DESCRIPTION:
29 # Space separated list of patches to apply after unpacking the sources.
30 # Patch files are searched for in the current working dir, WORKDIR, and
31 -# FILESDIR.
32 +# FILESDIR. This variable is semi-deprecated, preferably use the
33 +# PATCHES array instead if the EAPI supports it.
34
35 # @ECLASS-VARIABLE: ELISP_REMOVE
36 # @DEFAULT_UNSET
37 @@ -59,12 +60,6 @@
38 # Space separated list of Texinfo sources. Respective GNU Info files
39 # will be generated in src_compile() and installed in src_install().
40
41 -# @ECLASS-VARIABLE: DOCS
42 -# @DEFAULT_UNSET
43 -# @DESCRIPTION:
44 -# DOCS="blah.txt ChangeLog" is automatically used to install the given
45 -# files by dodoc in src_install().
46 -
47 inherit elisp-common
48 case ${EAPI:-0} in
49 4|5) inherit epatch ;;
50 @@ -101,7 +96,7 @@ elisp_pkg_setup() {
51 # WORKDIR for packages distributed that way.
52
53 elisp_src_unpack() {
54 - [[ -n ${A} ]] && unpack ${A}
55 + default
56 if [[ -f ${P}.el ]]; then
57 # the "simple elisp" case with a single *.el file in WORKDIR
58 mv ${P}.el ${PN}.el || die
59 @@ -132,10 +127,10 @@ elisp_src_prepare() {
60 esac
61 done
62
63 - # apply any user patches
64 + # apply PATCHES (if supported in EAPI), and any user patches
65 case ${EAPI} in
66 4|5) epatch_user ;;
67 - *) eapply_user ;;
68 + *) default ;;
69 esac
70
71 if [[ -n ${ELISP_REMOVE} ]]; then
72 @@ -177,11 +172,13 @@ elisp_src_install() {
73 if [[ -n ${ELISP_TEXINFO} ]]; then
74 set -- ${ELISP_TEXINFO}
75 set -- ${@##*/}
76 - doinfo ${@/%.*/.info*} || die
77 - fi
78 - if [[ -n ${DOCS} ]]; then
79 - dodoc ${DOCS} || die
80 + doinfo ${@/%.*/.info*}
81 fi
82 + # install documentation only when explicitly requested
83 + case ${EAPI} in
84 + 4|5) [[ -n ${DOCS} ]] && dodoc ${DOCS} ;;
85 + *) declare -p DOCS &>/dev/null && einstalldocs ;;
86 + esac
87 if declare -f readme.gentoo_create_doc >/dev/null; then
88 readme.gentoo_create_doc
89 fi