Gentoo Archives: gentoo-dev

From: "Justin Lecher (jlec)" <jlec@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] RFC: intel-sdp-r1.eclass
Date: Mon, 15 Feb 2016 14:41:57
Message-Id: 56C1E3B6.9090108@gentoo.org
In Reply to: Re: [gentoo-dev] RFC: intel-sdp-r1.eclass by "Michał Górny"
1 On 15/02/16 15:35, Michał Górny wrote:
2 > On Mon, 15 Feb 2016 14:37:41 +0100
3 > "Justin Lecher (jlec)" <jlec@g.o> wrote:
4 >
5 >> On 15/02/16 13:59, Michał Górny wrote:
6 >>> On Mon, 15 Feb 2016 09:16:53 +0100
7 >>> "Justin Lecher (jlec)" <jlec@g.o> wrote:
8 >>>
9 >>>> # @ECLASS-VARIABLE: INTEL_SUBDIR
10 >>>> # @DEFAULT_UNSET
11 >>>> # @DESCRIPTION:
12 >>>> # The package sub-directory where it will end-up in /opt/intel
13 >>>> # To find out its value, you have to do a raw install from the Intel tar ball
14 >>>
15 >>> To be honest, I find this kinda terrible. There's a huge block of docs
16 >>> which makes me feel small and confused. Maybe it'd useful to give some
17 >>> semi-complete example on top (in global doc)?
18 >>
19 >> That makes definitely make sense. We will add one.
20 >>
21 >> Although nobody other then the maintainer of this eclass will ever use it.
22 >
23 > Remember that maintainers can change. It's better to have good then
24 > have new maintainers figure out all stuff over again.
25 >
26 >>>> # e.g. CLI_install/rpm/intel-vtune-amplifier-xe-cli
27 >>>> : ${INTEL_BIN_RPMS:=()}
28 >>>
29 >>> $ : ${foo:=()}
30 >>> $ declare -p foo
31 >>> declare -- foo="()"
32 >>>
33 >>> In other words, it doesn't work the way you expect it to.
34 >>
35 >> I already wondered about this. Is there any way to force a variable to
36 >> be an array in bash? Or define it as an empty array?
37 >
38 > Look at e.g. python-utils-r1.
39 >
40 > To check for array:
41 >
42 > if [[ $(declare -p foo) != "declare -a"* ]]; then
43 > ...
44 > fi
45 >
46 > To default to empty, simple (yet a bit imperfect) way:
47 >
48 > [[ ${foo[@]} }] || foo=()
49
50 And what about the default assignment for the man page?
51
52 >
53 >>>> # @ECLASS-VARIABLE: INTEL_SINGLE_ARCH
54 >>>> # @DESCRIPTION:
55 >>>> # Unset, if only the multilib package will be provided by intel
56 >>>> : ${INTEL_SINGLE_ARCH:=true}
57 >>>
58 >>> This is really weird. It sounds like I'm supposed to do:
59 >>>
60 >>> inherit intel-sdp-r1
61 >>> unset INTEL_SINGLE_ARCH
62 >>>
63 >>> I suggest you used positive logic instead.
64 >>
65 >> The wording is wrong. Setting it to anything but "true" like
66 >> "INTEL_SINGLE_ARCH=false" works. We will fix the wording.
67 >
68 > I still think positive logic is better. That is, a variable which
69 > defaults to, say, unset, and changes behavior if it becomes set to
70 > non-empty value.
71
72 we will look into that.
73
74 >
75 >>>> _isdp_big-warning() {
76 >>>> debug-print-function ${FUNCNAME} "${@}"
77 >>>>
78 >>>> case ${1} in
79 >>>> pre-check )
80 >>>> echo ""
81 >>>
82 >>> Don't mix echo with ewarn.
83 >>
84 >> Why?
85 >
86 > Because they won't go through the same output channels.
87 >
88 >>>> comp_full="${ED}/${INTEL_SDP_DIR}/linux/bin/${arch}/${comp}"
89 >>>
90 >>> Double slash imminent (ED has one).
91 >>
92 >> Always? Per definition?
93 >
94 > Yes, sadly. i wanted to change this but it's unlikely to go since it
95 > makes EAPI migration hard. If you really want to cover both cases, you
96 > can always do ${foo%/}/bar.
97 >
98 >>>> # @CODE
99 >>>
100 >>> Err, this is not code, you know.
101 >>
102 >> This is needed for nice formatting. Otherwise there is no line break
103 >
104 > Add an empty line between the two. That should do it correctly, without
105 > code blocks in devmanual.
106
107 That will introduce an empty line between the two points.
108
109 >
110 >>>> #maybe use nullglob or [[ $(echo ${dir/*lic) != "${dir}/*lic" ]]
111 >>>> [[ $( ls "${dir}"/*lic 2>/dev/null ) ]]; ret=$?
112 >>>
113 >>> Maybe you should use something sane indeed.
114 >
115 > Maybe file_exists from eutils could help here btw.
116 >
117 >>> Wouldn't you be able to collapse that into one loop?
118 >>
119 >> no, because the first has ${INTEL_X86}.rpm as suffeix and the later has
120 >> ${INTEL_X86}.rpm.
121 >
122 > Errrrr... am I reading wrong, or did you just type the same thing twice?
123
124 right, it should be ${INTEL_X86}.rpm vs noarch.rpm
125
126 >
127 >>>> einfo "Unpacking ${rb}"
128 >>>> rpm2tar -O ${r} | tar xvf - | sed -e \
129 >>>> "s:^\.:${EROOT#/}:g" > /dev/null; assert "unpacking ${r} failed"
130 >>>
131 >>> What's the deal with this sed?
132 >>
133 >> Good question, but it was there since always and probably the original
134 >> author had good reasons for it. We will look into it and comment the code.
135 >
136 > Didn't it change in the past? As I see it, tar here outputs file names,
137 > sed edits them and then you discard them to /dev/null. In this case,
138 > sed doesn't return any specific exit code so it seems to be a complete
139 > no-op.
140 >
141 > Maybe originally it verbosely output the extracted files.
142 >
143 >>>> EXPORT_FUNCTIONS pkg_setup src_unpack src_install pkg_postinst pkg_postrm pkg_pretend
144 >>>
145 >>> We usually do this on top, and it's better to do it outside guards so
146 >>> that order from inherit is always respected.
147 >>
148 >> we will move it up. I don't get your second comment. Do you mean the
149 >> case someone does
150 >>
151 >> inherit intel-sdp-r1 some-other-eclass intel-sdp
152 >>
153 >> ?
154 >
155 > Rather something unlikely like:
156 >
157 > inherit foo bar intel-sdp-r1
158 >
159 > where foo inherits intel-sdp-r1, and therefore the exports occur before
160 > bar, and bar takes over even though intel-sdp-r1 is explicitly
161 > listed last.
162 >

Attachments

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

Replies

Subject Author
Re: [gentoo-dev] RFC: intel-sdp-r1.eclass "Michał Górny" <mgorny@g.o>