1 |
commit: d5beda4d171865e8f8c4e6e23d7cea110bff40fb |
2 |
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Dec 19 14:15:05 2015 +0000 |
4 |
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Dec 21 07:52:26 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d5beda4d |
7 |
|
8 |
readme.gentoo-r1.eclass: Do not inherit eutils. |
9 |
|
10 |
This was only needed in readme.gentoo_create_doc() for a single call |
11 |
of eshopts_{push,pop}. Replace it by saving the set of options in a |
12 |
variable. Die if writing the temp file in readme.gentoo_create_doc() |
13 |
fails. |
14 |
|
15 |
eclass/readme.gentoo-r1.eclass | 11 +++++------ |
16 |
1 file changed, 5 insertions(+), 6 deletions(-) |
17 |
|
18 |
diff --git a/eclass/readme.gentoo-r1.eclass b/eclass/readme.gentoo-r1.eclass |
19 |
index c076650..07320c0 100644 |
20 |
--- a/eclass/readme.gentoo-r1.eclass |
21 |
+++ b/eclass/readme.gentoo-r1.eclass |
22 |
@@ -21,8 +21,6 @@ |
23 |
if [[ -z ${_README_GENTOO_ECLASS} ]]; then |
24 |
_README_GENTOO_ECLASS=1 |
25 |
|
26 |
-inherit eutils |
27 |
- |
28 |
case "${EAPI:-0}" in |
29 |
0|1|2|3) |
30 |
die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" |
31 |
@@ -61,15 +59,16 @@ readme.gentoo_create_doc() { |
32 |
debug-print-function ${FUNCNAME} "${@}" |
33 |
|
34 |
if [[ -n "${DOC_CONTENTS}" ]]; then |
35 |
- eshopts_push |
36 |
- set -f |
37 |
if [[ -n "${DISABLE_AUTOFORMATTING}" ]]; then |
38 |
- echo "${DOC_CONTENTS}" > "${T}"/README.gentoo |
39 |
+ echo "${DOC_CONTENTS}" > "${T}"/README.gentoo || die |
40 |
else |
41 |
+ local saved_flags=$- |
42 |
+ set -f # disable filename expansion in echo arguments |
43 |
echo -e ${DOC_CONTENTS} | fold -s -w 70 \ |
44 |
| sed 's/[[:space:]]*$//' > "${T}"/README.gentoo |
45 |
+ assert |
46 |
+ set +f -${saved_flags} |
47 |
fi |
48 |
- eshopts_pop |
49 |
elif [[ -f "${FILESDIR}/README.gentoo-${SLOT%/*}" ]]; then |
50 |
cp "${FILESDIR}/README.gentoo-${SLOT%/*}" "${T}"/README.gentoo || die |
51 |
elif [[ -f "${FILESDIR}/README.gentoo${README_GENTOO_SUFFIX}" ]]; then |