From cdbe274e3d0c184d53f098fa2bc0c5d5f0dc09fb Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 4 Jan 2012 05:57:19 +0000 Subject: [PATCH] add missing "local" markings for variables --- eclass/portability.eclass | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/eclass/portability.eclass b/eclass/portability.eclass index 196254a4150a..800a11404631 100644 --- a/eclass/portability.eclass +++ b/eclass/portability.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/portability.eclass,v 1.23 2011/12/27 17:55:12 fauli Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/portability.eclass,v 1.24 2012/01/04 05:57:19 vapier Exp $ # # Author: Diego Pettenò # @@ -15,11 +15,11 @@ ___ECLASS_ONCE_PORTABILITY="recur -_+^+_- spank" # # mimic cp --parents copy, but working on BSD userland as well treecopy() { - dest=${!#} - files_count=$# + local dest=${!#} + local files_count=$# - while(( $# > 1 )); do - dirstruct=$(dirname "$1") + while (( $# > 1 )); do + local dirstruct=$(dirname "$1") mkdir -p "${dest}/${dirstruct}" cp -pPR "$1" "${dest}/${dirstruct}" @@ -38,6 +38,7 @@ seq() { return $? fi + local min max step case $# in 1) min=1 max=$1 step=1 ;; 2) min=$1 max=$2 step=1 ;; -- 2.26.2