1 |
commit: 42fe7eadad8c80836ace0de527e988383f63b7da |
2 |
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Feb 20 13:04:34 2020 +0000 |
4 |
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Feb 20 13:27:33 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=42fe7ead |
7 |
|
8 |
einstalldocs: Fix test for DOCS being unset. |
9 |
|
10 |
The current test does not exactly test for unset DOCS, because it also |
11 |
evaluates as true if the variable has attributes. Such attributes can |
12 |
be defined even for an unset variable. |
13 |
|
14 |
Therefore test the output of declare -p for presence of an = sign |
15 |
instead, which indicates that a value has been assigned to the |
16 |
variable (bug 710076 comment #2). |
17 |
|
18 |
PMS reference: Algorithm 12.4, line 7: |
19 |
https://projects.gentoo.org/pms/7/pms.html#x1-135011r183 |
20 |
|
21 |
See also bash upstream discussion: |
22 |
https://lists.gnu.org/archive/html/bug-bash/2020-02/msg00045.html |
23 |
|
24 |
Closes: https://bugs.gentoo.org/710076 |
25 |
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> |
26 |
|
27 |
bin/phase-helpers.sh | 4 ++-- |
28 |
1 file changed, 2 insertions(+), 2 deletions(-) |
29 |
|
30 |
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh |
31 |
index 3deb28c68..9495465f9 100644 |
32 |
--- a/bin/phase-helpers.sh |
33 |
+++ b/bin/phase-helpers.sh |
34 |
@@ -1,5 +1,5 @@ |
35 |
#!/bin/bash |
36 |
-# Copyright 1999-2019 Gentoo Authors |
37 |
+# Copyright 1999-2020 Gentoo Authors |
38 |
# Distributed under the terms of the GNU General Public License v2 |
39 |
|
40 |
if ___eapi_has_DESTTREE_INSDESTTREE; then |
41 |
@@ -953,7 +953,7 @@ fi |
42 |
if ___eapi_has_einstalldocs; then |
43 |
einstalldocs() { |
44 |
( |
45 |
- if ! declare -p DOCS &>/dev/null ; then |
46 |
+ if [[ $(declare -p DOCS 2>/dev/null) != *=* ]]; then |
47 |
local d |
48 |
for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \ |
49 |
THANKS BUGS FAQ CREDITS CHANGELOG ; do |