diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-10-12 18:15:25 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-10-12 18:15:25 +0100 |
commit | 36c436b12f9ef2523e5fd963381b78d2dc5cc53d (patch) | |
tree | f275068802d3c71dcdd97439f906e36237263361 /eclass/dotnet-pkg-base.eclass | |
parent | 3a0e100e02e1c6c2818268f57eae51095cee35af (diff) |
gentoo auto-resync : 12:10:2023 - 18:15:24
Diffstat (limited to 'eclass/dotnet-pkg-base.eclass')
-rw-r--r-- | eclass/dotnet-pkg-base.eclass | 68 |
1 files changed, 29 insertions, 39 deletions
diff --git a/eclass/dotnet-pkg-base.eclass b/eclass/dotnet-pkg-base.eclass index c7f2e031daec..5b2d6e2dd2c1 100644 --- a/eclass/dotnet-pkg-base.eclass +++ b/eclass/dotnet-pkg-base.eclass @@ -305,35 +305,37 @@ dotnet-pkg-base_info() { } # @FUNCTION: dotnet-pkg-base_foreach-solution -# @USAGE: <function> [directory] +# @USAGE: <directory> <args> ... # @DESCRIPTION: # Execute a function for each solution file (.sln) in a specified directory. # This function may yield no real results because solutions are discovered # automatically. # -# Optional "directory" argument defaults to the current directory path. -# -# Used by "dotnet-pkg_src_configure" from the "dotnet-pkg" eclass. +# Used by "dotnet-pkg_src_configure" and "dotnet-pkg_src_test" from +# the "dotnet-pkg" eclass. dotnet-pkg-base_foreach-solution() { debug-print-function "${FUNCNAME[0]}" "${@}" + local directory="${1}" + shift + local dotnet_solution local dotnet_solution_name while read -r dotnet_solution ; do dotnet_solution_name="$(basename "${dotnet_solution}")" - ebegin "Running \"${1}\" for solution: \"${dotnet_solution_name}\"" - "${1}" "${dotnet_solution}" + ebegin "Running \"${@}\" for solution: \"${dotnet_solution_name}\"" + "${@}" "${dotnet_solution}" eend $? "${FUNCNAME[0]}: failed for solution: \"${dotnet_solution}\"" || die - done < <(find "${2:-.}" -maxdepth 1 -type f -name "*.sln") + done < <(find "${directory}" -maxdepth 1 -type f -name "*.sln") } # @FUNCTION: dotnet-pkg-base_restore -# @USAGE: [directory] [args] ... +# @USAGE: [args] ... # @DESCRIPTION: -# Restore the package using "dotnet restore" in a specified directory. -# -# Optional "directory" argument defaults to the current directory path. +# Restore the package using "dotnet restore". +# Restore is performed in current directory unless a different directory is +# passed via "args". # # Additionally any number of "args" maybe be given, they are appended to # the "dotnet" command invocation. @@ -342,14 +344,6 @@ dotnet-pkg-base_foreach-solution() { dotnet-pkg-base_restore() { debug-print-function "${FUNCNAME[0]}" "${@}" - local directory - if [[ "${1}" ]] ; then - directory="${1}" - shift - else - directory="$(pwd)" - fi - local -a restore_args=( --runtime "${DOTNET_PKG_RUNTIME}" --source "${NUGET_PACKAGES}" @@ -357,7 +351,7 @@ dotnet-pkg-base_restore() { "${@}" ) - edotnet restore "${restore_args[@]}" "${directory}" + edotnet restore "${restore_args[@]}" } # @FUNCTION: dotnet-pkg-base_restore_tools @@ -377,7 +371,7 @@ dotnet-pkg-base_restore_tools() { --add-source "${NUGET_PACKAGES}" ) - if [[ "${1}" ]] ; then + if [[ -n "${1}" ]] ; then tool_restore_args+=( --configfile "${1}" ) shift fi @@ -388,11 +382,11 @@ dotnet-pkg-base_restore_tools() { } # @FUNCTION: dotnet-pkg-base_build -# @USAGE: [directory] [args] ... +# @USAGE: [args] ... # @DESCRIPTION: # Build the package using "dotnet build" in a specified directory. -# -# Optional "directory" argument defaults to the current directory path. +# Build is performed in current directory unless a different directory is +# passed via "args". # # Additionally any number of "args" maybe be given, they are appended to # the "dotnet" command invocation. @@ -401,14 +395,6 @@ dotnet-pkg-base_restore_tools() { dotnet-pkg-base_build() { debug-print-function "${FUNCNAME[0]}" "${@}" - local directory - if [[ "${1}" ]] ; then - directory="${1}" - shift - else - directory="$(pwd)" - fi - local -a build_args=( --configuration "${DOTNET_PKG_CONFIGURATION}" --no-restore @@ -416,7 +402,6 @@ dotnet-pkg-base_build() { --output "${DOTNET_PKG_OUTPUT}" --runtime "${DOTNET_PKG_RUNTIME}" -maxCpuCount:$(makeopts_jobs) - "${@}" ) if ! use debug ; then @@ -426,7 +411,12 @@ dotnet-pkg-base_build() { ) fi - edotnet build "${build_args[@]}" "${directory}" + # And append "args" at the end. + build_args+=( + "${@}" + ) + + edotnet build "${build_args[@]}" } # @FUNCTION: dotnet-pkg-base_test @@ -444,7 +434,7 @@ dotnet-pkg-base_test() { debug-print-function "${FUNCNAME[0]}" "${@}" local directory - if [[ "${1}" ]] ; then + if [[ -n "${1}" ]] ; then directory="${1}" shift else @@ -539,7 +529,7 @@ dotnet-pkg-base_dolauncher() { local executable_path executable_name - if [[ "${1}" ]] ; then + if [[ -n "${1}" ]] ; then local executable_path="${1}" shift else @@ -563,9 +553,9 @@ dotnet-pkg-base_dolauncher() { # compatible with dotnet version ${DOTNET_PKG_COMPAT}. for __dotnet_root in \\ - ${EPREFIX}/usr/$(get_libdir)/dotnet-sdk-${DOTNET_PKG_COMPAT} \\ - ${EPREFIX}/opt/dotnet-sdk-bin-${DOTNET_PKG_COMPAT} ; do - [ -d \${__dotnet_root} ] && break + "${EPREFIX}/usr/$(get_libdir)/dotnet-sdk-${DOTNET_PKG_COMPAT}" \\ + "${EPREFIX}/opt/dotnet-sdk-bin-${DOTNET_PKG_COMPAT}" ; do + [ -d "\${__dotnet_root}" ] && break done DOTNET_ROOT="\${__dotnet_root}" |