diff options
author | ArsenShnurkov <Arsen.Shnurkov@gmail.com> | 2016-08-17 15:06:20 +0300 |
---|---|---|
committer | ArsenShnurkov <Arsen.Shnurkov@gmail.com> | 2016-08-17 15:06:20 +0300 |
commit | 194ea096838a961a453b646966bc750c444ceedd (patch) | |
tree | a47e1069b61fb063964273f0e5972ab8ec16966d /eclass | |
parent | Merge pull request #219 from ArsenShnurkov/fixes (diff) | |
download | dotnet-194ea096838a961a453b646966bc750c444ceedd.tar.gz dotnet-194ea096838a961a453b646966bc750c444ceedd.tar.bz2 dotnet-194ea096838a961a453b646966bc750c444ceedd.zip |
make nuget optional
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/nuget.eclass | 33 | ||||
-rw-r--r-- | 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 + <?xml version="1.0" encoding="utf-8" ?> + <configuration> + <config> + <add key="repositoryPath" value="$(get_nuget_untrusted_archives_location)" /> + </config> + <disabledPackageSources /> + </configuration> + 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 - <?xml version="1.0" encoding="utf-8" ?> - <configuration> - <config> - <add key="repositoryPath" value="$(get_nuget_untrusted_archives_location)" /> - </config> - <disabledPackageSources /> - </configuration> - 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 |