From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 98783158020 for ; Sat, 26 Nov 2022 10:54:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CB9D4E09EC; Sat, 26 Nov 2022 10:54:35 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id AFC79E09E9 for ; Sat, 26 Nov 2022 10:54:35 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D43A43414A2 for ; Sat, 26 Nov 2022 10:54:34 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id F01D3776 for ; Sat, 26 Nov 2022 10:54:30 +0000 (UTC) From: "Florian Schmaus" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Florian Schmaus" Message-ID: <1669376220.d39cc4f19da2e3fc1a58665aa26156e4608455a5.flow@gentoo> Subject: [gentoo-commits] repo/proj/guru:master commit in: eclass/ X-VCS-Repository: repo/proj/guru X-VCS-Files: eclass/dotnet-utils.eclass X-VCS-Directories: eclass/ X-VCS-Committer: flow X-VCS-Committer-Name: Florian Schmaus X-VCS-Revision: d39cc4f19da2e3fc1a58665aa26156e4608455a5 X-VCS-Branch: master Date: Sat, 26 Nov 2022 10:54:30 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 4b4f97a5-8d0c-44e7-8517-c0ad1d40813b X-Archives-Hash: 6a78e7b13c6763f6e3a84a838eb52d5f commit: d39cc4f19da2e3fc1a58665aa26156e4608455a5 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Fri Nov 25 11:25:07 2022 +0000 Commit: Florian Schmaus gentoo org> CommitDate: Fri Nov 25 11:37:00 2022 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=d39cc4f1 dotnet-utils.eclass: small improvements Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/dotnet-utils.eclass | 55 +++++++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 23 deletions(-) diff --git a/eclass/dotnet-utils.eclass b/eclass/dotnet-utils.eclass index e5c5d3c8f..745676186 100644 --- a/eclass/dotnet-utils.eclass +++ b/eclass/dotnet-utils.eclass @@ -20,31 +20,37 @@ _DOTNET_UTILS_ECLASS=1 inherit multiprocessing # @ECLASS_VARIABLE: DOTNET_SLOT +# @REQUIRED +# @PRE_INHERIT # @DESCRIPTION: -# Allows for choosing a slot for dotnet -# @DEFAULT_UNSET +# Allows to choose a slot for dotnet -if [[ -z "${DOTNET_SLOT}" ]]; then - die "DOTNET_SLOT not set." +if [[ ! ${DOTNET_SLOT} ]]; then + die "${ECLASS}: DOTNET_SLOT not set" fi # Temporary, use the virtual once you can have multiple virtuals installed at once BDEPEND+=" || ( dev-dotnet/dotnet-sdk:${DOTNET_SLOT} dev-dotnet/dotnet-sdk-bin:${DOTNET_SLOT} )" # @ECLASS_VARIABLE: DOTNET_EXECUTABLE -# @DESCRIPTION: -# Holds the right executable name # @DEFAULT_UNSET +# @DESCRIPTION: +# Sets the right executable name. # @ECLASS_VARIABLE: DOTNET_CLI_TELEMETRY_OPTOUT +# @OUTPUT_VARIABLE # @DESCRIPTION: # Disables telemetry on dotnet. export DOTNET_CLI_TELEMETRY_OPTOUT=1 + # @ECLASS_VARIABLE: MSBUILDDISABLENODEREUSE +# @OUTPUT_VARIABLE # @DESCRIPTION: -# Stops the dotnet node from not stopping after the build is done. +# Stops the dotnet node after the build is done. export MSBUILDDISABLENODEREUSE=1 + # @ECLASS_VARIABLE: DOTNET_NOLOGO +# @OUTPUT_VARIABLE # @DESCRIPTION: # Disables the header logo when running dotnet commands. export DOTNET_NOLOGO=1 @@ -54,37 +60,40 @@ RESTRICT+=" strip" # @ECLASS_VARIABLE: NUGETS # @DEFAULT_UNSET -# @PRE_INHERIT # @DESCRIPTION: -# bash string containing all nuget package wants to download -# used by nuget_uris() +# String containing all nuget packages that need to be downloaded. Used by +# the 'nuget_uris' function. +# # Example: # @CODE # NUGETS=" -# ImGui.NET-1.87.2 -# Config.Net-4.19.0 +# ImGui.NET-1.87.2 +# Config.Net-4.19.0 # " -# inherit nuget +# +# inherit dotnet-utils +# # ... +# # SRC_URI="$(nuget_uris)" # @CODE # @FUNCTION: nuget_uris +# @USAGE: # @DESCRIPTION: # Generates the URIs to put in SRC_URI to help fetch dependencies. -# Uses first argument as nuget list. -# If no argument provided, uses NUGETS variable. +# If no arguments provided, uses NUGETS variable. nuget_uris() { local -r regex='^([a-zA-Z0-9_.-]+)-([0-9]+\.[0-9]+\.[0-9]+.*)$' local nuget nugets - if [[ -n ${@} ]]; then - nugets="$@" - elif [[ -n ${NUGETS} ]]; then + if (( $# != 0 )); then + nugets="${@}" + elif [[ ${NUGETS} ]]; then nugets="${NUGETS}" else eerror "NUGETS variable is not defined and nothing passed as argument" - die "Can't generate SRC_URI from empty input" + die "${FUNCNAME}: Can't generate SRC_URI from empty input" fi for nuget in ${nugets}; do @@ -150,7 +159,7 @@ edotnet() { # @DESCRIPTION: # Unpacks the package dotnet-utils_src_unpack() { - debug-print-function ${FUNCNAME} "$@" + debug-print-function ${FUNCNAME} "${@}" local archive for archive in ${A}; do @@ -167,9 +176,9 @@ dotnet-utils_src_unpack() { # @FUNCTION: dotnet-utils_src_prepare # @DESCRIPTION: # Restores the packages - dotnet-utils_src_prepare() { - debug-print-function ${FUNCNAME} "$@" + debug-print-function ${FUNCNAME} "${@}" + edotnet restore \ --source "${DISTDIR}" || die default @@ -179,7 +188,7 @@ dotnet-utils_src_prepare() { # @DESCRIPTION: # Build the package using dotnet publish dotnet-utils_src_compile() { - debug-print-function ${FUNCNAME} "$@" + debug-print-function ${FUNCNAME} "${@}" edotnet publish \ --no-restore \