Gentoo Archives: gentoo-commits

From: Florian Schmaus <flow@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:master commit in: eclass/
Date: Sat, 26 Nov 2022 10:54:41
Message-Id: 1669376221.20ac305c615fa9f437476ce1c42db6171b6fc48b.flow@gentoo
1 commit: 20ac305c615fa9f437476ce1c42db6171b6fc48b
2 Author: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
3 AuthorDate: Fri Nov 25 11:30:29 2022 +0000
4 Commit: Florian Schmaus <flow <AT> gentoo <DOT> org>
5 CommitDate: Fri Nov 25 11:37:01 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=20ac305c
7
8 dotnet-utils.eclass: match use-flags instead of ${ARCH}
9
10 Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq.in>
11
12 eclass/dotnet-utils.eclass | 34 +++++++++++++++-------------------
13 1 file changed, 15 insertions(+), 19 deletions(-)
14
15 diff --git a/eclass/dotnet-utils.eclass b/eclass/dotnet-utils.eclass
16 index 9e15fb08c..ea7c6591e 100644
17 --- a/eclass/dotnet-utils.eclass
18 +++ b/eclass/dotnet-utils.eclass
19 @@ -97,7 +97,7 @@ nuget_uris() {
20
21 for nuget in ${nugets}; do
22 local name version url
23 - [[ $nuget =~ $regex ]] || die "Could not parse name and version from nuget: $nuget"
24 + [[ ${nuget} =~ ${regex} ]] || die "Could not parse name and version from nuget: $nuget"
25 name="${BASH_REMATCH[1]}"
26 version="${BASH_REMATCH[2]}"
27 url="https://api.nuget.org/v3-flatcontainer/${name}/${version}/${name}.${version}.nupkg"
28 @@ -109,24 +109,20 @@ nuget_uris() {
29 # @DESCRIPTION:
30 # Sets up DOTNET_RUNTIME and DOTNET_EXECUTABLE variables for later use in edotnet.
31 dotnet-utils_pkg_setup() {
32 - case "${ARCH}" in
33 - *amd64)
34 - DOTNET_RUNTIME="linux-x64"
35 - ;;
36 - *arm)
37 - DOTNET_RUNTIME="linux-arm"
38 - ;;
39 - *arm64)
40 - DOTNET_RUNTIME="linux-arm64"
41 - ;;
42 - *)
43 - die "Unsupported arch: ${ARCH}"
44 - ;;
45 - esac
46 -
47 - for _dotnet in dotnet-{${DOTNET_SLOT},bin-${DOTNET_SLOT}}; do
48 - if type $_dotnet 1> /dev/null 2>&1; then
49 - DOTNET_EXECUTABLE=$_dotnet
50 + if use amd64; then
51 + DOTNET_RUNTIME="linux-x64"
52 + elif use arm; then
53 + DOTNET_RUNTIME="linux-arm"
54 + elif use arm64; then
55 + DOTNET_RUNTIME="linux-arm64"
56 + else
57 + die "Unsupported arch: ${ARCH}"
58 + fi
59 +
60 + local _dotnet
61 + for _dotnet in dotnet{,-bin}-${DOTNET_SLOT}; do
62 + if type ${_dotnet} 1> /dev/null 2>&1; then
63 + DOTNET_EXECUTABLE=${_dotnet}
64 break
65 fi
66 done