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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D782213832E for ; Fri, 19 Aug 2016 16:12:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 76F3321C038; Fri, 19 Aug 2016 16:12:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A0005E0B27 for ; Fri, 19 Aug 2016 16:12:22 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5C4943406DD for ; Fri, 19 Aug 2016 16:12:21 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9558E8F4 for ; Fri, 19 Aug 2016 16:12:19 +0000 (UTC) From: "Mikhail Pukhlikov" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mikhail Pukhlikov" Message-ID: <1471435580.194ea096838a961a453b646966bc750c444ceedd.cynede@gentoo> Subject: [gentoo-commits] proj/dotnet:master commit in: eclass/ X-VCS-Repository: proj/dotnet X-VCS-Files: eclass/nuget.eclass eclass/nupkg.eclass X-VCS-Directories: eclass/ X-VCS-Committer: cynede X-VCS-Committer-Name: Mikhail Pukhlikov X-VCS-Revision: 194ea096838a961a453b646966bc750c444ceedd X-VCS-Branch: master Date: Fri, 19 Aug 2016 16:12:19 +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-Archives-Salt: 1aeebc40-27d1-4d76-9d60-ffbaca2f0a05 X-Archives-Hash: fd261aec45c0874ff514fd54fe2d7ad4 commit: 194ea096838a961a453b646966bc750c444ceedd Author: ArsenShnurkov gmail com> AuthorDate: Wed Aug 17 12:06:20 2016 +0000 Commit: Mikhail Pukhlikov gentoo org> CommitDate: Wed Aug 17 12:06:20 2016 +0000 URL: https://gitweb.gentoo.org/proj/dotnet.git/commit/?id=194ea096 make nuget optional eclass/nuget.eclass | 33 +++++++++++++++++++++++++++++++++ eclass/nupkg.eclass | 33 ++------------------------------- 2 files changed, 35 insertions(+), 31 deletions(-) diff --git a/eclass/nuget.eclass b/eclass/nuget.eclass index 02e13b8..3fbb21c 100644 --- a/eclass/nuget.eclass +++ b/eclass/nuget.eclass @@ -11,6 +11,39 @@ inherit nupkg +IUSE+=" +nuget" + +DEPEND+=" nuget? ( dev-dotnet/nuget )" +RDEPEND+=" nuget? ( dev-dotnet/nuget )" + +# @FUNCTION: enuget_download_rogue_binary +# @DESCRIPTION: downloads a binary package from 3rd untrusted party repository +# accepts Id of package as parameter +enuget_download_rogue_binary() { + CONFIG_PATH=${T}/.nuget + CONFIG_NAME=NuGet.Config + einfo "Downloading rogue binary '$1'" + addwrite "$(get_nuget_untrusted_archives_location)" || die + mkdir -p "$(get_nuget_untrusted_archives_location)" || die + einfo wget --continue https://www.nuget.org/api/v2/package/$1/$2 --output-document="$(get_nuget_untrusted_archives_location)/$1.$2.nupkg" + wget --continue https://www.nuget.org/api/v2/package/$1/$2 --output-document="$(get_nuget_untrusted_archives_location)/$1.$2.nupkg" || die + # -p ignores directory if it is already exists + mkdir -p "${CONFIG_PATH}/" || die + cat <<-EOF >"${CONFIG_PATH}/${CONFIG_NAME}" || die + + + + + + + + EOF + einfo "Installing rogue binary '$1' into '${S}/packages'" + einfo "$(pwd)" + einfo nuget install "$1" -Version "$2" -SolutionDirectory "${S}" -ConfigFile "${CONFIG_PATH}/${CONFIG_NAME}" -OutputDirectory "${S}/packages" -Verbosity detailed + nuget install "$1" -Version "$2" -SolutionDirectory "${T}" -ConfigFile "${CONFIG_PATH}/${CONFIG_NAME}" -OutputDirectory "${S}/packages" -Verbosity detailed || die +} + # @FUNCTION: nuget_src_unpack # @DESCRIPTION: Runs nuget # Here is usage example where nuget is alternative way: https://github.com/gentoo/dotnet/blob/master/dev-dotnet/fake diff --git a/eclass/nupkg.eclass b/eclass/nupkg.eclass index 03f5315..d50d65e 100644 --- a/eclass/nupkg.eclass +++ b/eclass/nupkg.eclass @@ -11,8 +11,8 @@ inherit dotnet IUSE+=" +nupkg" -DEPEND+=" dev-dotnet/nuget" -RDEPEND+=" dev-dotnet/nuget" +DEPEND+=" nupkg? ( dev-dotnet/nuget )" +RDEPEND+=" nupkg? ( dev-dotnet/nuget )" # @FUNCTION: get_nuget_trusted_icons_location # @USAGE: [directory] @@ -74,35 +74,6 @@ enuget_restore() { nuget restore "$@" || die } -CONFIG_PATH=${T}/.nuget -CONFIG_NAME=NuGet.Config - -# @FUNCTION: enuget_download_rogue_binary -# @DESCRIPTION: downloads a binary package from 3rd untrusted party repository -# accepts Id of package as parameter -enuget_download_rogue_binary() { - einfo "Downloading rogue binary '$1'" - addwrite "$(get_nuget_untrusted_archives_location)" || die - mkdir -p "$(get_nuget_untrusted_archives_location)" || die - einfo wget --continue https://www.nuget.org/api/v2/package/$1/$2 --output-document="$(get_nuget_untrusted_archives_location)/$1.$2.nupkg" - wget --continue https://www.nuget.org/api/v2/package/$1/$2 --output-document="$(get_nuget_untrusted_archives_location)/$1.$2.nupkg" || die - # -p ignores directory if it is already exists - mkdir -p "${CONFIG_PATH}/" || die - cat <<-EOF >"${CONFIG_PATH}/${CONFIG_NAME}" || die - - - - - - - - EOF - einfo "Installing rogue binary '$1' into '${S}/packages'" - einfo "$(pwd)" - einfo nuget install "$1" -Version "$2" -SolutionDirectory "${S}" -ConfigFile "${CONFIG_PATH}/${CONFIG_NAME}" -OutputDirectory "${S}/packages" -Verbosity detailed - nuget install "$1" -Version "$2" -SolutionDirectory "${T}" -ConfigFile "${CONFIG_PATH}/${CONFIG_NAME}" -OutputDirectory "${S}/packages" -Verbosity detailed || die -} - # @FUNCTION: enuspec # @DESCRIPTION: run nuget pack # accepts path to .nuspec file as parameter