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 B839B158020 for ; Fri, 25 Nov 2022 11:37:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 73BD5E0903; Fri, 25 Nov 2022 11:37:14 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5DC12E0903 for ; Fri, 25 Nov 2022 11:37:14 +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) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 354C7340EA6 for ; Fri, 25 Nov 2022 11:37:13 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8EC0B764 for ; Fri, 25 Nov 2022 11:37:11 +0000 (UTC) From: "Anna Vyalkova" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anna Vyalkova" Message-ID: <1669376220.d39cc4f19da2e3fc1a58665aa26156e4608455a5.cybertailor@gentoo> Subject: [gentoo-commits] repo/proj/guru:dev commit in: eclass/ X-VCS-Repository: repo/proj/guru X-VCS-Files: eclass/dotnet-utils.eclass X-VCS-Directories: eclass/ X-VCS-Committer: cybertailor X-VCS-Committer-Name: Anna Vyalkova X-VCS-Revision: d39cc4f19da2e3fc1a58665aa26156e4608455a5 X-VCS-Branch: dev Date: Fri, 25 Nov 2022 11:37:11 +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: 06becd5e-4d66-4040-b405-7427f0e2a200 X-Archives-Hash: d412d44f3b74dc0dcda5d67df570c42e commit: d39cc4f19da2e3fc1a58665aa26156e4608455a5 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Fri Nov 25 11:25:07 2022 +0000 Commit: Anna Vyalkova sysrq in> 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 \