diff options
author | Maciej Mrozowski <reavertm@gentoo.org> | 2011-12-17 03:57:38 +0000 |
---|---|---|
committer | Maciej Mrozowski <reavertm@gentoo.org> | 2011-12-17 03:57:38 +0000 |
commit | 7db0cca27766847afebbc9b22eb22574d1677a79 (patch) | |
tree | 5a96dc22c179647b144dd039149f1f4b5ec426a7 /eclass | |
parent | Fixed missing link, bug #394693 (diff) | |
download | gentoo-2-7db0cca27766847afebbc9b22eb22574d1677a79.tar.gz gentoo-2-7db0cca27766847afebbc9b22eb22574d1677a79.tar.bz2 gentoo-2-7db0cca27766847afebbc9b22eb22574d1677a79.zip |
Revert old eshopts_{pop,push} implementations until new ones pass unit tests. Bug 395025.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/ChangeLog | 6 | ||||
-rw-r--r-- | eclass/eutils.eclass | 24 |
2 files changed, 19 insertions, 11 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog index 9c9f1c1c1f2d..efa0857e9822 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for eclass directory # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.46 2011/12/16 20:02:48 abcd Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.47 2011/12/17 03:57:38 reavertm Exp $ + + 17 Dec 2011; Maciej Mrozowski <reavertm@gentoo.org> eutils.eclass: + Revert old eshopts_{pop,push} implementations until new ones pass unit tests. + Bug 395025. 16 Dec 2011; Jonathan Callen <abcd@gentoo.org> qt4-build.eclass: Set importdir to be /usr/$(get_libdir)/qt4/imports instead of the diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 8435fd35f73c..e09ba36eba1f 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.373 2011/12/16 23:38:41 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.374 2011/12/17 03:57:38 reavertm Exp $ # @ECLASS: eutils.eclass # @MAINTAINER: @@ -174,14 +174,15 @@ estack_pop() { eshopts_push() { # have to assume __ESHOPTS_SAVE__ isn't screwed with # as a `declare -a` here will reset its value + local i=${#__ESHOPTS_SAVE__[@]} if [[ $1 == -[su] ]] ; then - estack_push eshopts "$(shopt -p)" + __ESHOPTS_SAVE__[$i]=$(shopt -p) [[ $# -eq 0 ]] && return 0 - shopt "$@" || die "${FUNCNAME}: bad options to shopt: $*" + shopt "$@" || die "eshopts_push: bad options to shopt: $*" else - estack_push eshopts $- + __ESHOPTS_SAVE__[$i]=$- [[ $# -eq 0 ]] && return 0 - set "$@" || die "${FUNCNAME}: bad options to set: $*" + set "$@" || die "eshopts_push: bad options to set: $*" fi } @@ -191,13 +192,16 @@ eshopts_push() { # Restore the shell options to the state saved with the corresponding # eshopts_push call. See that function for more details. eshopts_pop() { - local s - estack_pop eshopts s || die "${FUNCNAME}: unbalanced push" + [[ $# -ne 0 ]] && die "eshopts_pop takes no arguments" + local i=$(( ${#__ESHOPTS_SAVE__[@]} - 1 )) + [[ ${i} -eq -1 ]] && die "eshopts_{push,pop}: unbalanced pair" + local s=${__ESHOPTS_SAVE__[$i]} + unset __ESHOPTS_SAVE__[$i] if [[ ${s} == "shopt -"* ]] ; then - eval "${s}" || die "${FUNCNAME}: sanity: invalid shopt options: ${s}" + eval "${s}" || die "eshopts_pop: sanity: invalid shopt options: ${s}" else - set +$- || die "${FUNCNAME}: sanity: invalid shell settings: $-" - set -${s} || die "${FUNCNAME}: sanity: unable to restore saved shell settings: ${s}" + set +$- || die "eshopts_pop: sanity: invalid shell settings: $-" + set -${s} || die "eshopts_pop: sanity: unable to restore saved shell settings: ${s}" fi } |