aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2020-02-20 14:04:34 +0100
committerUlrich Müller <ulm@gentoo.org>2020-02-20 14:27:33 +0100
commit42fe7eadad8c80836ace0de527e988383f63b7da (patch)
treece435e531f044ebd761676bf9e47ebc0bb7e6a11
parentasync_fetch_map: handle _parse_uri_map exception (bug 710130) (diff)
downloadportage-42fe7eadad8c80836ace0de527e988383f63b7da.tar.gz
portage-42fe7eadad8c80836ace0de527e988383f63b7da.tar.bz2
portage-42fe7eadad8c80836ace0de527e988383f63b7da.zip
einstalldocs: Fix test for DOCS being unset.
The current test does not exactly test for unset DOCS, because it also evaluates as true if the variable has attributes. Such attributes can be defined even for an unset variable. Therefore test the output of declare -p for presence of an = sign instead, which indicates that a value has been assigned to the variable (bug 710076 comment #2). PMS reference: Algorithm 12.4, line 7: https://projects.gentoo.org/pms/7/pms.html#x1-135011r183 See also bash upstream discussion: https://lists.gnu.org/archive/html/bug-bash/2020-02/msg00045.html Closes: https://bugs.gentoo.org/710076 Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r--bin/phase-helpers.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 3deb28c68..9495465f9 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
if ___eapi_has_DESTTREE_INSDESTTREE; then
@@ -953,7 +953,7 @@ fi
if ___eapi_has_einstalldocs; then
einstalldocs() {
(
- if ! declare -p DOCS &>/dev/null ; then
+ if [[ $(declare -p DOCS 2>/dev/null) != *=* ]]; then
local d
for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \
THANKS BUGS FAQ CREDITS CHANGELOG ; do