testing/py3-litex-hub-modules: avoid global exec

Shelling out in the global scope is expensive and in this case not
necessary, change the `cut` invocation to parameter substitution.

`${foo%:*}` cuts of the `:` and everything that comes after it, which is
the same as `| cut -d : -f 1` does.

`${foo#*:}` cuts of everything until and including the `:`, which is
the same as `| cut -d : -f 2` does.
This commit is contained in:
Kevin Daudt 2024-01-26 18:57:35 +00:00
parent a7a1a49e98
commit 80435b3f3e

View File

@ -73,11 +73,12 @@ options="!check"
options="$options !strip"
_repo_name() {
echo $1 | cut -d : -f 1
echo ${1%%:*}
}
_pkgver() {
echo $1 | cut -d : -f 2
a=${1%:*}
echo ${a#*:}
}
_version_by_name() {