1 |
commit: fa6556b9067e5b62d25244a42558456fa4e4458a |
2 |
Author: James Le Cuirot <chewi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Apr 16 10:18:28 2017 +0000 |
4 |
Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Apr 27 21:41:23 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa6556b9 |
7 |
|
8 |
cdrom.eclass: Change CDROM_CHECK_# variables to a CDROM_CHECKS array |
9 |
|
10 |
eclass/cdrom.eclass | 11 +++-------- |
11 |
1 file changed, 3 insertions(+), 8 deletions(-) |
12 |
|
13 |
diff --git a/eclass/cdrom.eclass b/eclass/cdrom.eclass |
14 |
index dac6992b678..069f1b36258 100644 |
15 |
--- a/eclass/cdrom.eclass |
16 |
+++ b/eclass/cdrom.eclass |
17 |
@@ -52,12 +52,8 @@ cdrom_get_cds() { |
18 |
# the # of files they gave us |
19 |
local cdcnt=0 |
20 |
local f= |
21 |
- for f in "$@" ; do |
22 |
- ((++cdcnt)) |
23 |
- export CDROM_CHECK_${cdcnt}="$f" |
24 |
- done |
25 |
export CDROM_TOTAL_CDS=${cdcnt} |
26 |
- export CDROM_CURRENT_CD=1 |
27 |
+ export CDROM_CURRENT_CD=1 CDROM_CHECKS=( "${@}" ) |
28 |
|
29 |
# now we see if the user gave use CD_ROOT ... |
30 |
# if they did, let's just believe them that it's correct |
31 |
@@ -80,7 +76,7 @@ cdrom_get_cds() { |
32 |
einfo "Found CD #${CDROM_CURRENT_CD} root at ${CDROM_ROOT}" |
33 |
export CDROM_SET=-1 |
34 |
local IFS=: |
35 |
- for f in ${CDROM_CHECK_1} ; do |
36 |
+ for f in ${CDROM_CHECKS[0]} ; do |
37 |
unset IFS |
38 |
((++CDROM_SET)) |
39 |
export CDROM_MATCH=$(_cdrom_glob_match "${CDROM_ROOT}" "${f}") |
40 |
@@ -149,8 +145,7 @@ cdrom_load_next_cd() { |
41 |
var=CD_ROOT_${CDROM_CURRENT_CD} |
42 |
[[ -z ${!var} ]] && var="CD_ROOT" |
43 |
if [[ -z ${!var} ]] ; then |
44 |
- var="CDROM_CHECK_${CDROM_CURRENT_CD}" |
45 |
- _cdrom_locate_file_on_cd ${!var} |
46 |
+ _cdrom_locate_file_on_cd "${CDROM_CHECKS[${CDROM_CURRENT_CD}]}" |
47 |
else |
48 |
export CDROM_ROOT=${!var} |
49 |
fi |