commit:     fa6556b9067e5b62d25244a42558456fa4e4458a
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 16 10:18:28 2017 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Thu Apr 27 21:41:23 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa6556b9

cdrom.eclass: Change CDROM_CHECK_# variables to a CDROM_CHECKS array

 eclass/cdrom.eclass | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/eclass/cdrom.eclass b/eclass/cdrom.eclass
index dac6992b678..069f1b36258 100644
--- a/eclass/cdrom.eclass
+++ b/eclass/cdrom.eclass
@@ -52,12 +52,8 @@ cdrom_get_cds() {
        # the # of files they gave us
        local cdcnt=0
        local f=
-       for f in "$@" ; do
-               ((++cdcnt))
-               export CDROM_CHECK_${cdcnt}="$f"
-       done
        export CDROM_TOTAL_CDS=${cdcnt}
-       export CDROM_CURRENT_CD=1
+       export CDROM_CURRENT_CD=1 CDROM_CHECKS=( "${@}" )
 
        # now we see if the user gave use CD_ROOT ...
        # if they did, let's just believe them that it's correct
@@ -80,7 +76,7 @@ cdrom_get_cds() {
                einfo "Found CD #${CDROM_CURRENT_CD} root at ${CDROM_ROOT}"
                export CDROM_SET=-1
                local IFS=:
-               for f in ${CDROM_CHECK_1} ; do
+               for f in ${CDROM_CHECKS[0]} ; do
                        unset IFS
                        ((++CDROM_SET))
                        export CDROM_MATCH=$(_cdrom_glob_match "${CDROM_ROOT}" 
"${f}")
@@ -149,8 +145,7 @@ cdrom_load_next_cd() {
        var=CD_ROOT_${CDROM_CURRENT_CD}
        [[ -z ${!var} ]] && var="CD_ROOT"
        if [[ -z ${!var} ]] ; then
-               var="CDROM_CHECK_${CDROM_CURRENT_CD}"
-               _cdrom_locate_file_on_cd ${!var}
+               _cdrom_locate_file_on_cd "${CDROM_CHECKS[${CDROM_CURRENT_CD}]}"
        else
                export CDROM_ROOT=${!var}
        fi

Reply via email to