Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Sat, 15 May 2021 22:01:16
Message-Id: 1621115359.0005bf29df8f6d99df07ef180219f5fe22ebb3d6.asturm@gentoo
1 commit: 0005bf29df8f6d99df07ef180219f5fe22ebb3d6
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sat May 15 20:56:46 2021 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sat May 15 21:49:19 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0005bf29
7
8 readme.gentoo.eclass: Remove last-rited eclass
9
10 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
11
12 eclass/readme.gentoo.eclass | 140 --------------------------------------------
13 1 file changed, 140 deletions(-)
14
15 diff --git a/eclass/readme.gentoo.eclass b/eclass/readme.gentoo.eclass
16 deleted file mode 100644
17 index c902605538a..00000000000
18 --- a/eclass/readme.gentoo.eclass
19 +++ /dev/null
20 @@ -1,140 +0,0 @@
21 -# Copyright 1999-2021 Gentoo Authors
22 -# Distributed under the terms of the GNU General Public License v2
23 -
24 -# @DEAD
25 -# @ECLASS: readme.gentoo.eclass
26 -# @MAINTAINER:
27 -# Pacho Ramos <pacho@g.o>
28 -# @AUTHOR:
29 -# Author: Pacho Ramos <pacho@g.o>
30 -# @SUPPORTED_EAPIS: 4 5
31 -# @BLURB: install a doc file shown via elog messages
32 -# @DEPRECATED: readme.gentoo-r1
33 -# @DESCRIPTION:
34 -# An eclass for installing a README.gentoo doc file recording tips
35 -# shown via elog messages. With this eclass, those elog messages will only be
36 -# shown at first package installation and a file for later reviewing will be
37 -# installed under /usr/share/doc/${PF}
38 -
39 -if [[ -z ${_README_GENTOO_ECLASS} ]]; then
40 -_README_GENTOO_ECLASS=1
41 -
42 -inherit estack eutils
43 -
44 -case "${EAPI:-0}" in
45 - 0|1|2|3)
46 - die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
47 - ;;
48 - 4|5)
49 - # EAPI>=4 is required for REPLACING_VERSIONS preventing us
50 - # from needing to export another pkg_preinst phase to save has_version
51 - # result. Also relies on EAPI >=4 default src_install phase.
52 - EXPORT_FUNCTIONS src_install pkg_postinst
53 - ;;
54 - 6)
55 - die "Unsupported EAPI=${EAPI} for ${ECLASS}"
56 - die "Please migrate to readme.gentoo-r1.eclass and note that"
57 - die "it stops to export any ebuild phases and, then, you will"
58 - die "need to ensure readme.gentoo_create_doc is called in"
59 - die "src_install and readme.gentoo_print_elog in pkg_postinst"
60 - ;;
61 - *)
62 - die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
63 - ;;
64 -esac
65 -
66 -# @ECLASS-VARIABLE: DISABLE_AUTOFORMATTING
67 -# @DEFAULT_UNSET
68 -# @DESCRIPTION:
69 -# If non-empty, DOC_CONTENTS information will be strictly respected,
70 -# not getting it automatically formatted by fmt. If empty, it will
71 -# rely on fmt for formatting and 'echo -e' options to tweak lines a bit.
72 -
73 -# @ECLASS-VARIABLE: FORCE_PRINT_ELOG
74 -# @DEFAULT_UNSET
75 -# @DESCRIPTION:
76 -# If non-empty this variable forces elog messages to be printed.
77 -
78 -# @ECLASS-VARIABLE: README_GENTOO_SUFFIX
79 -# @DESCRIPTION:
80 -# If you want to specify a suffix for README.gentoo file please export it.
81 -: ${README_GENTOO_SUFFIX:=""}
82 -
83 -# @FUNCTION: readme.gentoo_create_doc
84 -# @DESCRIPTION:
85 -# Create doc file with ${DOC_CONTENTS} variable (preferred) and, if not set,
86 -# look for "${FILESDIR}/README.gentoo" contents. You can use
87 -# ${FILESDIR}/README.gentoo-${SLOT} also.
88 -# Usually called at src_install phase.
89 -readme.gentoo_create_doc() {
90 - debug-print-function ${FUNCNAME} "${@}"
91 -
92 - if [[ -n "${DOC_CONTENTS}" ]]; then
93 - eshopts_push
94 - set -f
95 - if [[ -n "${DISABLE_AUTOFORMATTING}" ]]; then
96 - echo "${DOC_CONTENTS}" > "${T}"/README.gentoo
97 - else
98 - echo -e ${DOC_CONTENTS} | fold -s -w 70 \
99 - | sed 's/[[:space:]]*$//' > "${T}"/README.gentoo
100 - fi
101 - eshopts_pop
102 - elif [[ -f "${FILESDIR}/README.gentoo-${SLOT%/*}" ]]; then
103 - cp "${FILESDIR}/README.gentoo-${SLOT%/*}" "${T}"/README.gentoo || die
104 - elif [[ -f "${FILESDIR}/README.gentoo${README_GENTOO_SUFFIX}" ]]; then
105 - cp "${FILESDIR}/README.gentoo${README_GENTOO_SUFFIX}" "${T}"/README.gentoo || die
106 - else
107 - die "You are not specifying README.gentoo contents!"
108 - fi
109 -
110 - dodoc "${T}"/README.gentoo
111 - README_GENTOO_DOC_VALUE=$(< "${T}/README.gentoo")
112 -}
113 -
114 -# @FUNCTION: readme.gentoo_print_elog
115 -# @DESCRIPTION:
116 -# Print elog messages with "${T}"/README.gentoo contents. They will be
117 -# shown only when package is installed at first time.
118 -# Usually called at pkg_postinst phase.
119 -#
120 -# If you want to show them always, please set FORCE_PRINT_ELOG to a non empty
121 -# value in your ebuild before this function is called.
122 -# This can be useful when, for example, DOC_CONTENTS is modified, then, you can
123 -# rely on specific REPLACING_VERSIONS handling in your ebuild to print messages
124 -# when people update from versions still providing old message.
125 -readme.gentoo_print_elog() {
126 - debug-print-function ${FUNCNAME} "${@}"
127 -
128 - eqawarn "${CATEGORY}/${PN} is using the deprecated readme.gentoo.eclass."
129 - eqawarn "Please use readme.gentoo-r1 instead."
130 -
131 - if [[ -z "${README_GENTOO_DOC_VALUE}" ]]; then
132 - die "readme.gentoo_print_elog invoked without matching readme.gentoo_create_doc call!"
133 - elif ! [[ -n "${REPLACING_VERSIONS}" ]] || [[ -n "${FORCE_PRINT_ELOG}" ]]; then
134 - echo -e "${README_GENTOO_DOC_VALUE}" | while read -r ELINE; do elog "${ELINE}"; done
135 - elog ""
136 - elog "(Note: Above message is only printed the first time package is"
137 - elog "installed. Please look at ${EPREFIX}/usr/share/doc/${PF}/README.gentoo*"
138 - elog "for future reference)"
139 - fi
140 -}
141 -
142 -
143 -# @FUNCTION: readme.gentoo_src_install
144 -# @DESCRIPTION:
145 -# Install generated doc file automatically.
146 -readme.gentoo_src_install() {
147 - debug-print-function ${FUNCNAME} "${@}"
148 - default
149 - readme.gentoo_create_doc
150 -}
151 -
152 -# @FUNCTION: readme.gentoo_pkg_postinst
153 -# @DESCRIPTION:
154 -# Show elog messages from from just generated doc file.
155 -readme.gentoo_pkg_postinst() {
156 - debug-print-function ${FUNCNAME} "${@}"
157 - readme.gentoo_print_elog
158 -}
159 -
160 -fi