diff options
author | James Le Cuirot <chewi@gentoo.org> | 2017-04-16 11:18:28 +0100 |
---|---|---|
committer | James Le Cuirot <chewi@gentoo.org> | 2017-04-27 22:41:23 +0100 |
commit | fa6556b9067e5b62d25244a42558456fa4e4458a (patch) | |
tree | e29cecd9a4bc005da3f7ba10403354873a1d3451 /eclass/cdrom.eclass | |
parent | cdrom.eclass: Fix important typo in the multiple disc instructions (diff) | |
download | gentoo-fa6556b9067e5b62d25244a42558456fa4e4458a.tar.gz gentoo-fa6556b9067e5b62d25244a42558456fa4e4458a.tar.bz2 gentoo-fa6556b9067e5b62d25244a42558456fa4e4458a.zip |
cdrom.eclass: Change CDROM_CHECK_# variables to a CDROM_CHECKS array
Diffstat (limited to 'eclass/cdrom.eclass')
-rw-r--r-- | eclass/cdrom.eclass | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/eclass/cdrom.eclass b/eclass/cdrom.eclass index dac6992b678e..069f1b362580 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 |