CODINGSTYLE: Drop non-posix parameter extensions

While the non-posix substring expansions and replacement expansions are
in use in portage already; they currently do not always work properly.

.githooks/pre-commit: 28: testing/gcc-cross-embedded/APKBUILD: Bad substitution

where line 28 reads:
	targetnorm="${target//-/_}"

So best to avoid this construct when it doesn't even work all the time.

A good replacement is:
	targetnorm="$(echo "${target}" | tr - _)"

which is posix compliant and works.
Signed-off-by: Olliver Schinagl's avatarOlliver Schinagl <oliver@schinagl.nl>
parent 6a46d5bc
Pipeline #40376 passed with stages
in 1 minute and 35 seconds
......@@ -8,13 +8,8 @@ APKBUILDs are POSIX shell scripts as defined in [POSIX.1-2017 Volume 3]
[POSIX.1-2017 volume 3]. Additionally, the following extensions are
supported:
1. The `local` keyword for introducing variables local to a function is
supported, it is briefly documented in the [bash manual][bash functions].
2. Non-POSIX [parameter extensions][POSIX.1-2017 parameter expansion]
are supported. This includes: Substring expansions (e.g.
`${var:offset:length}`) and Replacement expansions (e.g.
`${var/pattern/string}`). The [bash manual][bash expansion]
contains further information on these two expansions.
The `local` keyword for introducing variables local to a function is
supported, it is briefly documented in the [bash manual][bash functions].
**NOTE:** `busybox ash` is currently used to evaluate APKBUILDs since it
supports additional POSIX shell extensions your APKBUILD might be
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment