Gentoo Archives: gentoo-dev

From: James Le Cuirot <chewi@g.o>
To: gentoo-dev <gentoo-dev@l.g.o>
Cc: James Le Cuirot <chewi@g.o>
Subject: [gentoo-dev] [PATCH 03/14] cdrom.eclass: Rename CDROM_NAME_SET array to CDROM_NAMES
Date: Mon, 17 Apr 2017 21:56:19
Message-Id: 20170417215359.30641-4-chewi@gentoo.org
In Reply to: [gentoo-dev] [PATCH] cdrom.eclass: Near rewrite by James Le Cuirot
1 vapier seemed confused about what he wanted this variable to do as can
2 be seen in bug #139196. The eclass used it for the names of each disc,
3 regardless of the set, while ebuilds used it for the name of each
4 single-disc set. This was not helped by the fact that the set feature
5 has been totally undocumented. The former behaviour makes more sense
6 so let's rename the array to something less confusing.
7
8 This will not break ebuilds already using CDROM_NAME_SET. As they all
9 use just a single disc, they currently do not display the names given
10 in this variable anyway.
11 ---
12 eclass/cdrom.eclass | 8 ++++----
13 1 file changed, 4 insertions(+), 4 deletions(-)
14
15 diff --git a/eclass/cdrom.eclass b/eclass/cdrom.eclass
16 index f1839b189ae9..72250556e624 100644
17 --- a/eclass/cdrom.eclass
18 +++ b/eclass/cdrom.eclass
19 @@ -44,7 +44,7 @@ fi
20 # etc... If you want to give the cds better names, then just export
21 # the appropriate CDROM_NAME variable before calling cdrom_get_cds().
22 # Use CDROM_NAME for one cd, or CDROM_NAME_# for multiple cds. You can
23 -# also use the CDROM_NAME_SET bash array.
24 +# also use the CDROM_NAMES bash array.
25 #
26 # For those multi cd ebuilds, see the cdrom_load_next_cd() function.
27 cdrom_get_cds() {
28 @@ -102,12 +102,12 @@ cdrom_get_cds() {
29 einfo "export CD_ROOT=/mnt/cdrom"
30 echo
31 else
32 - if [[ -n ${CDROM_NAME_SET} ]] ; then
33 - # Translate the CDROM_NAME_SET array into CDROM_NAME_#
34 + if [[ -n ${CDROM_NAMES} ]] ; then
35 + # Translate the CDROM_NAMES array into CDROM_NAME_#
36 cdcnt=0
37 while [[ ${cdcnt} -lt ${CDROM_TOTAL_CDS} ]] ; do
38 ((++cdcnt))
39 - export CDROM_NAME_${cdcnt}="${CDROM_NAME_SET[$((${cdcnt}-1))]}"
40 + export CDROM_NAME_${cdcnt}="${CDROM_NAMES[$((${cdcnt}-1))]}"
41 done
42 fi
43
44 --
45 2.11.0