Revise init-tools.sh to support bootstrapping
authorSteve MacLean <sdmaclea.qdt@qualcommdatacenter.com>
Wed, 28 Feb 2018 17:00:31 +0000 (12:00 -0500)
committerSteve MacLean <sdmaclea.qdt@qualcommdatacenter.com>
Fri, 9 Mar 2018 19:18:08 +0000 (14:18 -0500)
Add $DotNetBootstrapCliTarPath
Disable ILAsm nuget fetch while bootstrapping

init-tools.sh

index 1df4f25..7f39d55 100755 (executable)
@@ -121,13 +121,18 @@ if [ ! -e $__DOTNET_PATH ]; then
     __DOTNET_LOCATION="https://dotnetcli.azureedge.net/dotnet/Sdk/${__DOTNET_TOOLS_VERSION}/${__DOTNET_PKG}.tar.gz"
 
     install_dotnet_cli() {
-        echo "Installing '${__DOTNET_LOCATION}' to '$__DOTNET_PATH/dotnet.tar'" >> "$__init_tools_log"
-        rm -rf -- "$__DOTNET_PATH/*"
-        # curl has HTTPS CA trust-issues less often than wget, so lets try that first.
-        if command -v curl > /dev/null; then
-            curl --retry 10 -sSL --create-dirs -o $__DOTNET_PATH/dotnet.tar ${__DOTNET_LOCATION}
+        if [[ "$DotNetBootstrapCliTarPath" = "" ]]; then
+            echo "Installing '${__DOTNET_LOCATION}' to '$__DOTNET_PATH/dotnet.tar'"
+            rm -rf -- "$__DOTNET_PATH/*"
+            # curl has HTTPS CA trust-issues less often than wget, so lets try that first.
+            if command -v curl > /dev/null; then
+                curl --retry 10 -sSL --create-dirs -o $__DOTNET_PATH/dotnet.tar ${__DOTNET_LOCATION}
+            else
+                wget -q -O $__DOTNET_PATH/dotnet.tar ${__DOTNET_LOCATION}
+            fi
         else
-            wget -q -O $__DOTNET_PATH/dotnet.tar ${__DOTNET_LOCATION}
+            echo "Copying '$DotNetBootstrapCliTarPath' to '$__DOTNET_PATH/dotnet.tar'"
+            cp $DotNetBootstrapCliTarPath $__DOTNET_PATH/dotnet.tar
         fi
         cd $__DOTNET_PATH
         tar -xf $__DOTNET_PATH/dotnet.tar
@@ -156,6 +161,11 @@ echo "Using RID $__ILASM_RID for BuildTools native tools"
 export ILASMCOMPILER_VERSION=$__ILASM_VERSION
 export NATIVE_TOOLS_RID=$__ILASM_RID
 
+if [ ! "$DotNetBootstrapCliTarPath" = "" ]; then
+    # Assume ilasm is not in nuget yet when bootstrapping...
+    unset ILASMCOMPILER_VERSION
+fi
+
 echo "Initializing BuildTools..."
 echo "Running: $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR $__PACKAGES_DIR" >> $__init_tools_log