1 |
On Mon, 15 Feb 2016 15:41:58 +0100 |
2 |
"Justin Lecher (jlec)" <jlec@g.o> wrote: |
3 |
|
4 |
> On 15/02/16 15:35, Michał Górny wrote: |
5 |
> > On Mon, 15 Feb 2016 14:37:41 +0100 |
6 |
> > "Justin Lecher (jlec)" <jlec@g.o> wrote: |
7 |
> > |
8 |
> >> On 15/02/16 13:59, Michał Górny wrote: |
9 |
> >>> On Mon, 15 Feb 2016 09:16:53 +0100 |
10 |
> >>> "Justin Lecher (jlec)" <jlec@g.o> wrote: |
11 |
> >>> |
12 |
> >>>> # @ECLASS-VARIABLE: INTEL_SUBDIR |
13 |
> >>>> # @DEFAULT_UNSET |
14 |
> >>>> # @DESCRIPTION: |
15 |
> >>>> # The package sub-directory where it will end-up in /opt/intel |
16 |
> >>>> # To find out its value, you have to do a raw install from the Intel tar ball |
17 |
> >>> |
18 |
> >>> To be honest, I find this kinda terrible. There's a huge block of docs |
19 |
> >>> which makes me feel small and confused. Maybe it'd useful to give some |
20 |
> >>> semi-complete example on top (in global doc)? |
21 |
> >> |
22 |
> >> That makes definitely make sense. We will add one. |
23 |
> >> |
24 |
> >> Although nobody other then the maintainer of this eclass will ever use it. |
25 |
> > |
26 |
> > Remember that maintainers can change. It's better to have good then |
27 |
> > have new maintainers figure out all stuff over again. |
28 |
> > |
29 |
> >>>> # e.g. CLI_install/rpm/intel-vtune-amplifier-xe-cli |
30 |
> >>>> : ${INTEL_BIN_RPMS:=()} |
31 |
> >>> |
32 |
> >>> $ : ${foo:=()} |
33 |
> >>> $ declare -p foo |
34 |
> >>> declare -- foo="()" |
35 |
> >>> |
36 |
> >>> In other words, it doesn't work the way you expect it to. |
37 |
> >> |
38 |
> >> I already wondered about this. Is there any way to force a variable to |
39 |
> >> be an array in bash? Or define it as an empty array? |
40 |
> > |
41 |
> > Look at e.g. python-utils-r1. |
42 |
> > |
43 |
> > To check for array: |
44 |
> > |
45 |
> > if [[ $(declare -p foo) != "declare -a"* ]]; then |
46 |
> > ... |
47 |
> > fi |
48 |
> > |
49 |
> > To default to empty, simple (yet a bit imperfect) way: |
50 |
> > |
51 |
> > [[ ${foo[@]} }] || foo=() |
52 |
> |
53 |
> And what about the default assignment for the man page? |
54 |
|
55 |
Have no clue. I think someone mentioned some hack somewhere. Or maybe |
56 |
we could finally fix eclass-manpages script to handle this. |
57 |
|
58 |
> >>> Err, this is not code, you know. |
59 |
> >> |
60 |
> >> This is needed for nice formatting. Otherwise there is no line break |
61 |
> > |
62 |
> > Add an empty line between the two. That should do it correctly, without |
63 |
> > code blocks in devmanual. |
64 |
> |
65 |
> That will introduce an empty line between the two points. |
66 |
|
67 |
Which is quite correct. And in any case, it's definitely not worse than |
68 |
what you're causing now: |
69 |
|
70 |
https://devmanual.gentoo.org/eclass-reference/intel-sdp.eclass/index.html |
71 |
|
72 |
> >>> Wouldn't you be able to collapse that into one loop? |
73 |
> >> |
74 |
> >> no, because the first has ${INTEL_X86}.rpm as suffeix and the later has |
75 |
> >> ${INTEL_X86}.rpm. |
76 |
> > |
77 |
> > Errrrr... am I reading wrong, or did you just type the same thing twice? |
78 |
> |
79 |
> right, it should be ${INTEL_X86}.rpm vs noarch.rpm |
80 |
|
81 |
Well, I think you still could handle this with some extra code |
82 |
and conditionals, at least reduced code duplication. |
83 |
|
84 |
-- |
85 |
Best regards, |
86 |
Michał Górny |
87 |
<http://dev.gentoo.org/~mgorny/> |