commit: 20ac305c615fa9f437476ce1c42db6171b6fc48b
Author: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
AuthorDate: Fri Nov 25 11:30:29 2022 +0000
Commit: Anna Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
CommitDate: Fri Nov 25 11:37:01 2022 +0000
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=20ac305c
dotnet-utils.eclass: match use-flags instead of ${ARCH}
Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq.in>
eclass/dotnet-utils.eclass | 34 +++++++++++++++-------------------
1 file changed, 15 insertions(+), 19 deletions(-)
diff --git a/eclass/dotnet-utils.eclass b/eclass/dotnet-utils.eclass
index 9e15fb08c..ea7c6591e 100644
--- a/eclass/dotnet-utils.eclass
+++ b/eclass/dotnet-utils.eclass
@@ -97,7 +97,7 @@ nuget_uris() {
for nuget in ${nugets}; do
local name version url
- [[ $nuget =~ $regex ]] || die "Could not parse name and version
from nuget: $nuget"
+ [[ ${nuget} =~ ${regex} ]] || die "Could not parse name and
version from nuget: $nuget"
name="${BASH_REMATCH[1]}"
version="${BASH_REMATCH[2]}"
url="https://api.nuget.org/v3-flatcontainer/${name}/${version}/${name}.${version}.nupkg"
@@ -109,24 +109,20 @@ nuget_uris() {
# @DESCRIPTION:
# Sets up DOTNET_RUNTIME and DOTNET_EXECUTABLE variables for later use in
edotnet.
dotnet-utils_pkg_setup() {
- case "${ARCH}" in
- *amd64)
- DOTNET_RUNTIME="linux-x64"
- ;;
- *arm)
- DOTNET_RUNTIME="linux-arm"
- ;;
- *arm64)
- DOTNET_RUNTIME="linux-arm64"
- ;;
- *)
- die "Unsupported arch: ${ARCH}"
- ;;
- esac
-
- for _dotnet in dotnet-{${DOTNET_SLOT},bin-${DOTNET_SLOT}}; do
- if type $_dotnet 1> /dev/null 2>&1; then
- DOTNET_EXECUTABLE=$_dotnet
+ if use amd64; then
+ DOTNET_RUNTIME="linux-x64"
+ elif use arm; then
+ DOTNET_RUNTIME="linux-arm"
+ elif use arm64; then
+ DOTNET_RUNTIME="linux-arm64"
+ else
+ die "Unsupported arch: ${ARCH}"
+ fi
+
+ local _dotnet
+ for _dotnet in dotnet{,-bin}-${DOTNET_SLOT}; do
+ if type ${_dotnet} 1> /dev/null 2>&1; then
+ DOTNET_EXECUTABLE=${_dotnet}
break
fi
done