summaryrefslogtreecommitdiff
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
commitcc6b3a2e0f381275588340eb384057c92da5b319 (patch)
tree3b6941a6533c16b1abed8e0125ad26355d117750 /eclass/multibuild.eclass
parentFix root offset support for bug #458156, thanks to smkbot. (diff)
downloadhistorical-cc6b3a2e0f381275588340eb384057c92da5b319.tar.gz
historical-cc6b3a2e0f381275588340eb384057c92da5b319.tar.bz2
historical-cc6b3a2e0f381275588340eb384057c92da5b319.zip
Fix compatibility with bash-4.1 -- it does not support negative array subscripts.
Diffstat (limited to 'eclass/multibuild.eclass')
-rw-r--r--eclass/multibuild.eclass7
1 files changed, 5 insertions, 2 deletions
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 "${@}"
}