summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2013-03-10 21:44:01 +0000
committerMichał Górny <mgorny@gentoo.org>2013-03-10 21:44:01 +0000
commitd98343d7be7b884a3ce4ea397747e945d8ba0c25 (patch)
tree390e91ba7a67783762099be4826925f2fa95f12c /eclass
parentUse functions from readme.gentoo.eclass instead of elog. (diff)
downloadhistorical-d98343d7be7b884a3ce4ea397747e945d8ba0c25.tar.gz
historical-d98343d7be7b884a3ce4ea397747e945d8ba0c25.tar.bz2
historical-d98343d7be7b884a3ce4ea397747e945d8ba0c25.zip
Make the log output redirection much simpler. Fix bash-3.2 compatibility.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog5
-rw-r--r--eclass/multibuild.eclass18
2 files changed, 8 insertions, 15 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 2708bf99a249..c0917cf2abf2 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for eclass directory
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.734 2013/03/10 21:00:28 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.735 2013/03/10 21:44:00 mgorny Exp $
+
+ 10 Mar 2013; Michał Górny <mgorny@gentoo.org> multibuild.eclass:
+ Make the log output redirection much simpler. Fix bash-3.2 compatibility.
10 Mar 2013; Michał Górny <mgorny@gentoo.org> multibuild.eclass:
Fix compatibility with bash-4.1 -- it does not support negative array
diff --git a/eclass/multibuild.eclass b/eclass/multibuild.eclass
index 193c20a4411e..a3f1402088ab 100644
--- a/eclass/multibuild.eclass
+++ b/eclass/multibuild.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/multibuild.eclass,v 1.7 2013/03/10 21:00:29 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/multibuild.eclass,v 1.8 2013/03/10 21:44:01 mgorny Exp $
# @ECLASS: multibuild
# @MAINTAINER:
@@ -113,11 +113,6 @@ multibuild_foreach_variant() {
local MULTIBUILD_VARIANT=${v}
local MULTIBUILD_ID=${prev_id}${v}
local BUILD_DIR=${bdir%%/}-${v}
- local log_fd
-
- # redirect_alloc_fd accepts files only. so we need to open
- # a random file and then reuse the fd for logger process.
- redirect_alloc_fd log_fd /dev/null
_multibuild_run() {
# find the first non-private command
@@ -130,14 +125,9 @@ multibuild_foreach_variant() {
"${@}"
}
- # bash can't handle ${log_fd} in redirections,
- # we need to use eval to pass fd numbers directly.
- eval "
- exec ${log_fd}> >(exec tee -a \"\${T}/build-\${MULTIBUILD_ID}.log\")
- _multibuild_run \"\${@}\" >&${log_fd} 2>&1
- lret=\${?}
- exec ${log_fd}>&-
- "
+ _multibuild_run "${@}" \
+ > >(exec tee -a "${T}/build-${MULTIBUILD_ID}.log") 2>&1
+ lret=${?}
done
[[ ${ret} -eq 0 && ${lret} -ne 0 ]] && ret=${lret}