Gentoo Archives: gentoo-dev

From: Mike Frysinger <vapier@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: RFD: split out some functions from eutils.eclass?
Date: Wed, 18 Jan 2012 20:40:03
Message-Id: 201201181539.25176.vapier@gentoo.org
In Reply to: Re: [gentoo-dev] Re: RFD: split out some functions from eutils.eclass? by "Michał Górny"
1 On Wednesday 18 January 2012 15:28:45 Michał Górny wrote:
2 > On Wed, 18 Jan 2012 15:16:02 -0500 Mike Frysinger wrote:
3 > > On Wednesday 18 January 2012 15:14:05 Michał Górny wrote:
4 > > > On Wed, 18 Jan 2012 14:29:27 -0500 Mike Frysinger wrote:
5 > > > > On Wednesday 18 January 2012 14:11:14 Michał Górny wrote:
6 > > > > > On Wed, 18 Jan 2012 09:48:59 -0500 Mike Frysinger wrote:
7 > > > > > > On Wednesday 18 January 2012 08:39:04 Michał Górny wrote:
8 > > > > > > > On Wed, 18 Jan 2012 06:22:24 -0500 Mike Frysinger wrote:
9 > > > > > > > > > > # now we see if the user gave use CD_ROOT ...
10 > > > > > > > > > > # if they did, let's just believe them that
11 > > > > > > > > > >
12 > > > > > > > > > > it's
13 > > > > > > > > > >
14 > > > > > > > > > > correct if [[ -n ${CD_ROOT}${CD_ROOT_1} ]] ; then
15 > > > > > > > > > >
16 > > > > > > > > > > local var=
17 > > > > > > > > > > cdcnt=0
18 > > > > > > > > > > while [[ ${cdcnt} -lt
19 > > > > > > > > > >
20 > > > > > > > > > > ${CDROM_TOTAL_CDS}
21 > > > > > > > > > >
22 > > > > > > > > > > ]] ; do ((++cdcnt))
23 > > > > > > > > > >
24 > > > > > > > > > > var="CD_ROOT_${cdcnt}"
25 > > > > > > > > > > [[ -z ${!var} ]] &&
26 > > > > > > > > > >
27 > > > > > > > > > > var="CD_ROOT" if [[ -z ${!var} ]] ; then
28 > > > > > > > > > >
29 > > > > > > > > > > eerror "You must
30 > > > > > > > > > >
31 > > > > > > > > > > either
32 > > > > > > > > > >
33 > > > > > > > > > > use just the CD_ROOT" eerror "or specify ALL the
34 > > > > > > > > > > CD_ROOT_X variables." eerror "In this case, you will
35 > > > > > > > > > > need" \ "${CDROM_TOTAL_CDS} CD_ROOT_X
36 > > > > > > > > > > variables." die "could not locate CD_ROOT_${cdcnt}"
37 > > > > > > > > > >
38 > > > > > > > > > > fi
39 > > > > > > > > > >
40 > > > > > > > > > > done
41 > > > > > > > > > > export
42 > > > > > > > > > >
43 > > > > > > > > > > CDROM_ROOT=${CD_ROOT_1:-${CD_ROOT}} einfo "Found CD
44 > > > > > > > > > > #${CDROM_CURRENT_CD} root
45 > > > > > > > > > >
46 > > > > > > > > > > at ${CDROM_ROOT}"
47 > > > > > > > > >
48 > > > > > > > > > #1. You are using 1 in variable calls, I don't see a
49 > > > > > > > > > reason to use longer ${CDROM_CURRENT_CD} in this one
50 > > > > > > > > > output case.
51 > > > > > > > >
52 > > > > > > > > i don't know what you mean
53 > > > > > > >
54 > > > > > > > einfo "Found CD #1 root at ..."
55 > > > > > >
56 > > > > > > *shrug* i preferred the # in the output
57 > > > > >
58 > > > > > I don't get what you mean. I just say it's pointless to use
59 > > > > > ${CDROM_CURRENT_CD} here.
60 > > > >
61 > > > > in multi cd sets, it keeps thing clearer imo at little cost
62 > > >
63 > > > Consdiering that you always use ${CD_ROOT_1}?
64 > >
65 > > yes. i want to see the disc # and path.
66 >
67 > But isn't CDROM_CURRENT_ID always 1 there?
68
69 yes. this func is the primer so it starts at 1, and after this, people call
70 cdrom_load_next_cd which then prints out:
71 einfo "Found CD #2 root at ..."
72 einfo "Found CD #3 root at ..."
73 einfo "Found CD #4 root at ..."
74 since they have the same `einfo` message structure
75
76 i could replace the variable in the first einfo with a "1", but it gains
77 nothing, and imo kills the "these messages are clearly in sync between these
78 two funcs".
79 -mike

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] Re: RFD: split out some functions from eutils.eclass? "Michał Górny" <mgorny@g.o>