summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2013-03-10 21:00:29 +0000
committerMichał Górny <mgorny@gentoo.org>2013-03-10 21:00:29 +0000
commit3ac9ab0e8cfe2c1728d720d118754fbc4eb8f79e (patch)
treea851c4be8addacb1ada3f13652d81382c2f9b92a /eclass
parentFix root offset support for bug #458156, thanks to smkbot. (diff)
downloadgentoo-2-3ac9ab0e8cfe2c1728d720d118754fbc4eb8f79e.tar.gz
gentoo-2-3ac9ab0e8cfe2c1728d720d118754fbc4eb8f79e.tar.bz2
gentoo-2-3ac9ab0e8cfe2c1728d720d118754fbc4eb8f79e.zip
Fix compatibility with bash-4.1 -- it does not support negative array subscripts.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog6
-rw-r--r--eclass/multibuild.eclass7
2 files changed, 10 insertions, 3 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index dd1a2e2b352e..2708bf99a249 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for eclass directory
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.733 2013/03/10 09:05:32 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.734 2013/03/10 21:00:28 mgorny Exp $
+
+ 10 Mar 2013; Michał Górny <mgorny@gentoo.org> multibuild.eclass:
+ Fix compatibility with bash-4.1 -- it does not support negative array
+ subscripts.
10 Mar 2013; Michał Górny <mgorny@gentoo.org> multibuild.eclass:
multibuild_copy_sources: fix outputting variant name.
diff --git a/eclass/multibuild.eclass b/eclass/multibuild.eclass
index bc510e999863..193c20a4411e 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.6 2013/03/10 09:05:32 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/multibuild.eclass,v 1.7 2013/03/10 21:00:29 mgorny Exp $
# @ECLASS: multibuild
# @MAINTAINER:
@@ -201,7 +201,10 @@ multibuild_for_best_variant() {
[[ ${MULTIBUILD_VARIANTS} ]] \
|| die "MULTIBUILD_VARIANTS need to be set"
- local MULTIBUILD_VARIANTS=( "${MULTIBUILD_VARIANTS[-1]}" )
+ # bash-4.1 can't handle negative subscripts
+ local MULTIBUILD_VARIANTS=(
+ "${MULTIBUILD_VARIANTS[$(( ${#MULTIBUILD_VARIANTS[@]} - 1 ))]}"
+ )
multibuild_foreach_variant "${@}"
}