Gentoo Archives: gentoo-dev

From: alicef_gentoo <alicef@g.o>
To: gentoo-dev@l.g.o
Cc: steven.stallion@××××.com
Subject: Re: [gentoo-dev] [PATCH] linux-mod.eclass: Fix MODULESD_* for hyphenated modules (bug #889752)
Date: Thu, 12 Jan 2023 06:51:51
Message-Id: 20230112065140.5folktgjv4ryezfz@alicef-pc
In Reply to: Re: [gentoo-dev] [PATCH] linux-mod.eclass: Fix MODULESD_* for hyphenated modules (bug #889752) by Mike Pagano
1 On Fri, Jan 06, 2023 at 08:03:51AM -0500, Mike Pagano wrote:
2 > On 1/4/23 19:06, Patrick McLean wrote:
3 > > From: Steven Stallion <steven.stallion@××××.com>
4 > >
5 > > Use of the MODULESD_<modulename>_{ADDITIONS,ALIASES,EXAMPLES} variables do not
6 > > currently work with external modules that are hyphenated. The current behavior
7 > > results in an invalid modprobe.d file containing partially evaluated content.
8 > >
9 > > This appears to be due to use of ${currm} rather than ${currm_t} when
10 > > Referencing variables. This changes the use of ${currm} to ${currm_t} when
11 > > referencing variables to resolve this issue.
12 > >
13 > > Closes: https://bugs.gentoo.org/889752
14 > > ---
15 > > eclass/linux-mod.eclass | 8 ++++----
16 > > 1 file changed, 4 insertions(+), 4 deletions(-)
17 > >
18 > > diff --git a/eclass/linux-mod.eclass b/eclass/linux-mod.eclass
19 > > index d14bbf7d9ea..6cf9969b19a 100644
20 > > --- a/eclass/linux-mod.eclass
21 > > +++ b/eclass/linux-mod.eclass
22 > > @@ -408,7 +408,7 @@ generate_modulesd() {
23 > > for((t=0; t<${module_aliases}; t++))
24 > > do
25 > > - echo "alias $(eval echo \${MODULESD_${currm}_ALIASES[$t]})" \
26 > > + echo "alias $(eval echo \${MODULESD_${currm_t}_ALIASES[$t]})" \
27 > > >> "${module_config}"
28 > > done
29 > > echo '' >> "${module_config}"
30 > > @@ -434,7 +434,7 @@ generate_modulesd() {
31 > > fi
32 > > #-----------------------------------------------------------------------
33 > > - if [[ $(eval echo \${MODULESD_${currm}_ALIASES[0]}) == guess ]]; then
34 > > + if [[ $(eval echo \${MODULESD_${currm_t}_ALIASES[0]}) == guess ]]; then
35 > > # So, let's do some guesswork, eh?
36 > > if [[ -n ${module_opts} ]]; then
37 > > echo "# For Example..." >> "${module_config}"
38 > > @@ -449,7 +449,7 @@ generate_modulesd() {
39 > > echo "# For Example..." >> "${module_config}"
40 > > echo "# --------------" >> "${module_config}"
41 > > for ((t=0; t<${module_examples}; t++)); do
42 > > - echo "options $(eval echo \${MODULESD_${currm}_EXAMPLES[$t]})" \
43 > > + echo "options $(eval echo \${MODULESD_${currm_t}_EXAMPLES[$t]})" \
44 > > >> "${module_config}"
45 > > done
46 > > echo '' >> "${module_config}"
47 > > @@ -458,7 +458,7 @@ generate_modulesd() {
48 > > #-----------------------------------------------------------------------
49 > > if [[ ${module_additions} -gt 0 ]]; then
50 > > for ((t=0; t<${module_additions}; t++)); do
51 > > - echo "$(eval echo \${MODULESD_${currm}_ADDITIONS[$t]})" \
52 > > + echo "$(eval echo \${MODULESD_${currm_t}_ADDITIONS[$t]})" \
53 > > >> "${module_config}"
54 > > done
55 > > echo '' >> "${module_config}"
56 >
57 >
58 > Ack
59 >
60
61 Ack
62
63 Thanks,
64 Alicef