From: | Ulrich Mueller <ulm@g.o> | ||
---|---|---|---|
To: | wuyy <xgreenlandforwyy@×××××.com> | ||
Cc: | Ulrich Mueller <ulm@g.o>, "gentoo-dev@l.g.o" <gentoo-dev@l.g.o>, Benda Xu <heroxbd@g.o> | ||
Subject: | Re: [gentoo-dev] [PATCH v2 1/2] rocm.eclass: new eclass | ||
Date: | Wed, 17 Aug 2022 07:15:01 | ||
Message-Id: | uzgg3pcii@gentoo.org | ||
In Reply to: | Re: [gentoo-dev] [PATCH v2 1/2] rocm.eclass: new eclass by wuyy |
1 | >>>>> On Wed, 17 Aug 2022, wuyy wrote: |
2 | |
3 | > Also, I have some long sentences in code, for throwing information. How |
4 | > do I nicely wrap such long strings in bash? By incremental assigning it |
5 | > to variables I guess? |
6 | |
7 | It's not an absolute rule. Avoid long lines where possible, but don't |
8 | jump through hoops to e.g. break long strings in assignments. |
9 | |
10 | >> No double empty lines please. (Pkgcheck should have complained about |
11 | >> this.) |
12 | |
13 | > OK. But `pkgcheck scan rocm.eclass` (version 0.10.12) does not |
14 | > complains. A missing feature maybe? |
15 | |
16 | Hm, it warns about it in ebuilds but not in eclasses. This looks like a |
17 | bug in pkgcheck to me. |
18 | |
19 | >> Please don't use internal Portage variables. |
20 | > OK, although I can't find such warnings on |
21 | > https://devmanual.gentoo.org/eclass-writing. Maybe an entry should be |
22 | > added? |
23 | |
24 | This is in PMS section 12.3.17 "Reserved commands and variables": |
25 | https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-13700012.3.17 |
26 | |
27 | Let's add it to the devmanual as well: |
28 | https://github.com/gentoo/devmanual/pull/301/commits/616323bd33f6aee5b579c24e31a4605c36e08b53 |
29 | |
30 | >> > + elif [[ -d "${BUILD_DIR}"/clients/staging ]]; then |
31 | >> |
32 | >> Quotation marks aren't necessary here. |
33 | |
34 | > What if BUILD_DIR contains spaces? |
35 | |
36 | That's not a problem because word splitting isn't performed inside [[ ]]: |
37 | https://www.gnu.org/software/bash/manual/html_node/Conditional-Constructs.html#index-_005b_005b |
38 | |
39 | Ulrich |
File name | MIME type |
---|---|
signature.asc | application/pgp-signature |