aboutsummaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorArsenShnurkov <Arsen.Shnurkov@gmail.com>2016-08-16 13:41:12 +0300
committerArsenShnurkov <Arsen.Shnurkov@gmail.com>2016-08-16 13:41:12 +0300
commit9c0d937d5bac3de8f4dc77cbeac0293d26ba54c7 (patch)
tree91c2e3d4afbd7660940b5d5865cae2d781a8c00d /eclass
parenttools updated (diff)
downloaddotnet-9c0d937d5bac3de8f4dc77cbeac0293d26ba54c7.tar.gz
dotnet-9c0d937d5bac3de8f4dc77cbeac0293d26ba54c7.tar.bz2
dotnet-9c0d937d5bac3de8f4dc77cbeac0293d26ba54c7.zip
version bump
Diffstat (limited to 'eclass')
-rw-r--r--eclass/nupkg.eclass56
1 files changed, 41 insertions, 15 deletions
diff --git a/eclass/nupkg.eclass b/eclass/nupkg.eclass
index 3234c99..3008e2d 100644
--- a/eclass/nupkg.eclass
+++ b/eclass/nupkg.eclass
@@ -9,6 +9,14 @@
inherit dotnet
+# @FUNCTION: get_nuget_trusted_icons_location
+# @USAGE: [directory]
+# @DESCRIPTION:
+# returns base directory for monodevelop addin icons
+get_nuget_trusted_icons_location() {
+ echo $(get_nuget_trusted_archives_location)/icons
+}
+
# @FUNCTION: get_nuget_trusted_archives_location
# @USAGE: [directory]
# @DESCRIPTION:
@@ -24,12 +32,19 @@ get_nuget_trusted_archives_location() {
fi
}
-# @FUNCTION: get_nuget_trusted_icons_location
+# @FUNCTION: get_nuget_trusted_archives_location
# @USAGE: [directory]
# @DESCRIPTION:
-# returns base directory for monodevelop addin icons
-get_nuget_trusted_icons_location() {
- echo $(get_nuget_trusted_archives_location)/icons
+# returns base directory for various nuget folders.
+get_nuget_untrusted_archives_location() {
+ if [ -d "/var/calculate/remote/distfiles" ]; then
+ # Control will enter here if the directory exist.
+ # this is necessary to handle calculate linux profiles feature (for corporate users)
+ echo /var/calculate/remote/packages/NuGet/nuget.org
+ else
+ # this is for all normal gentoo-based distributions
+ echo /usr/local/nuget/downloads/nuget.org
+ fi
}
# @FUNCTION: get_nuget_trusted_unpacked_location
@@ -40,7 +55,7 @@ get_nuget_trusted_unpacked_location() {
if [ -d "/var/calculate/remote/distfiles" ]; then
# Control will enter here if the directory exist.
# this is necessary to handle calculate linux profiles feature (for corporate users)
- echo /var/calculate/remote/distfiles/NuGet
+ echo /var/calculate/remote/distfiles/NuGet/packages
else
# this is for all normal gentoo-based distributions
echo /usr/local/nuget/packages
@@ -54,22 +69,33 @@ 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' into '${T}/$1.$2.nupkg'"
- wget -c https://www.nuget.org/api/v2/package/$1/$2 --directory-prefix="${T}/" --output-document="$1.$2.nupkg" || die
+ 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 "${T}/NuGet/" || die
- echo <<\EOF >"${T}/NuGet/NuGet.Config" || die
-<?xml version="1.0" encoding="utf-8" ?>
-<configuration><config>
-<add key="repositoryPath" value="${T}" />
-</config></configuration>
-EOF
+ 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'"
- nuget install "$1" -Version "$2" -OutputDirectory "${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