From c3063fa3dc701b148d042fca4730b3801e940871 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20G=C3=B3rny?= Date: Fri, 23 Sep 2011 13:55:47 +0000 Subject: [PATCH] Replace variable 'eval's with ${!foo}. --- eclass/git-2.eclass | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/eclass/git-2.eclass b/eclass/git-2.eclass index 0caa3d41d68c..cd0c0a71d679 100644 --- a/eclass/git-2.eclass +++ b/eclass/git-2.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/git-2.eclass,v 1.14 2011/08/22 04:46:31 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/git-2.eclass,v 1.15 2011/09/23 13:55:47 mgorny Exp $ # @ECLASS: git-2.eclass # @MAINTAINER: @@ -127,7 +127,8 @@ DEPEND="dev-vcs/git" git-2_init_variables() { debug-print-function ${FUNCNAME} "$@" - local x + local esc_pn liverepo livebranch livecommit + esc_pn=${PN//[-+]/_} : ${EGIT_SOURCEDIR="${S}"} @@ -139,19 +140,19 @@ git-2_init_variables() { : ${EGIT_MASTER:=master} - eval x="\$${PN//[-+]/_}_LIVE_REPO" - EGIT_REPO_URI=${x:-${EGIT_REPO_URI}} + liverepo=${esc_pn}_LIVE_REPO + EGIT_REPO_URI=${!liverepo:-${EGIT_REPO_URI}} [[ -z ${EGIT_REPO_URI} ]] && die "EGIT_REPO_URI must have some value" : ${EVCS_OFFLINE:=} - eval x="\$${PN//[-+]/_}_LIVE_BRANCH" - [[ -n ${x} ]] && ewarn "QA: using \"${PN//[-+]/_}_LIVE_BRANCH\" variable, you won't get any support" - EGIT_BRANCH=${x:-${EGIT_BRANCH:-${EGIT_MASTER}}} + livebranch=${esc_pn}_LIVE_BRANCH + [[ -n ${!livebranch} ]] && ewarn "QA: using \"${esc_pn}_LIVE_BRANCH\" variable, you won't get any support" + EGIT_BRANCH=${!livebranch:-${EGIT_BRANCH:-${EGIT_MASTER}}} - eval x="\$${PN//[-+]/_}_LIVE_COMMIT" - [[ -n ${x} ]] && ewarn "QA: using \"${PN//[-+]/_}_LIVE_COMMIT\" variable, you won't get any support" - EGIT_COMMIT=${x:-${EGIT_COMMIT:-${EGIT_BRANCH}}} + livecommit=${esc_pn}_LIVE_COMMIT + [[ -n ${!livecommit} ]] && ewarn "QA: using \"${esc_pn}_LIVE_COMMIT\" variable, you won't get any support" + EGIT_COMMIT=${!livecommit:-${EGIT_COMMIT:-${EGIT_BRANCH}}} : ${EGIT_REPACK:=} -- 2.26.2