From 474d2e590d8d16089386444fd7ea9782364bd7cf Mon Sep 17 00:00:00 2001 From: Ravi Eda Date: Thu, 13 Jul 2017 13:45:52 -0500 Subject: [CoreCLR] Display the contents of init-tools.log (#12795) * Update attribute-value in security build definition. * Display init-tools log. * Ensure execute permission is available. --- init-tools.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'init-tools.sh') diff --git a/init-tools.sh b/init-tools.sh index c076212ab5..4fc52d0107 100755 --- a/init-tools.sh +++ b/init-tools.sh @@ -40,6 +40,12 @@ OSName=$(uname -s) esac fi +display_error_message() +{ + echo "Please check the detailed log that follows." 1>&2 + cat "$__init_tools_log" 1>&2 +} + if [ ! -e $__INIT_TOOLS_DONE_MARKER ]; then __PATCH_CLI_NUGET_FRAMEWORKS=0 @@ -76,7 +82,6 @@ if [ ! -e $__INIT_TOOLS_DONE_MARKER ]; then fi fi - if [ -n "$BUILD_TOOLS_TOOLSET_DIR" ] && [ -d "$BUILD_TOOLS_TOOLSET_DIR/$__BUILD_TOOLS_PACKAGE_VERSION" ]; then echo "Copying $BUILD_TOOLS_TOOLSET_DIR/$__BUILD_TOOLS_PACKAGE_VERSION to $__TOOLRUNTIME_DIR" >> $__init_tools_log cp -r $BUILD_TOOLS_TOOLSET_DIR/$__BUILD_TOOLS_PACKAGE_VERSION/* $__TOOLRUNTIME_DIR @@ -88,7 +93,10 @@ if [ ! -e $__INIT_TOOLS_DONE_MARKER ]; then echo "Restoring BuildTools version $__BUILD_TOOLS_PACKAGE_VERSION..." echo "Running: $__DOTNET_CMD restore \"$__INIT_TOOLS_RESTORE_PROJECT\" --no-cache --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE /p:BuildToolsPackageVersion=$__BUILD_TOOLS_PACKAGE_VERSION" >> $__init_tools_log $__DOTNET_CMD restore "$__INIT_TOOLS_RESTORE_PROJECT" --no-cache --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE /p:BuildToolsPackageVersion=$__BUILD_TOOLS_PACKAGE_VERSION >> $__init_tools_log - if [ ! -e "$__BUILD_TOOLS_PATH/init-tools.sh" ]; then echo "ERROR: Could not restore build tools correctly. See '$__init_tools_log' for more details."1>&2; fi + if [ ! -e "$__BUILD_TOOLS_PATH/init-tools.sh" ]; then + echo "ERROR: Could not restore build tools correctly." 1>&2 + display_error_message + fi fi echo "Initializing BuildTools..." @@ -98,7 +106,8 @@ if [ ! -e $__INIT_TOOLS_DONE_MARKER ]; then chmod +x $__BUILD_TOOLS_PATH/init-tools.sh $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR >> $__init_tools_log if [ "$?" != "0" ]; then - echo "ERROR: An error occured when trying to initialize the tools. Please check '$__init_tools_log' for more details."1>&2 + echo "ERROR: An error occurred when trying to initialize the tools." 1>&2 + display_error_message exit 1 fi fi @@ -115,4 +124,4 @@ if [ ! -e $__INIT_TOOLS_DONE_MARKER ]; then echo "Done initializing tools." else echo "Tools are already initialized" -fi \ No newline at end of file +fi -- cgit v1.2.3