diff options
author | Oliver Wolff <oliver.wolff@qt.io> | 2018-02-14 07:46:11 +0100 |
---|---|---|
committer | Tony Sarajärvi <tony.sarajarvi@qt.io> | 2018-04-20 06:15:53 +0000 |
commit | 73621de8916b5d6d17a1dbd24c134d14c1c726a8 (patch) | |
tree | 8d1e21a4de97070e65183112fccc566a731788b2 /coin/provisioning/common/windows/icu.ps1 | |
parent | a37f4a2485d30710d743cecdaf1775b43792ed83 (diff) |
Unify Windows provisioning scripts & improve error handling
While Coin should also see exit codes != 0 as error, we should
stick to one way of handling script errors. As Power Shell cmdlets
signal an error by throwing an exception we should do the same
(and that approach also works in Coin).
Additionally extracting 7zip files was unified across scripts by
using the existing helper function instead of reinventing the wheel
again and again.
A similar helper function was introduced for starting an external
application (and handling its errors).
Also echo and other "cmd" commands were replaced by their PowerShell
equivalents to have a unified approach across our Windows provisioning
scripts.
Change-Id: I70129ce38692f1396c33c13b33a2918485fa5271
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
(cherry picked from commit cb6709ce5c48a31ba1170c71494c1a3869ffa5bb)
Reviewed-by: Simo Fält <simo.falt@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'coin/provisioning/common/windows/icu.ps1')
-rw-r--r-- | coin/provisioning/common/windows/icu.ps1 | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/coin/provisioning/common/windows/icu.ps1 b/coin/provisioning/common/windows/icu.ps1 index c08748d8..04f6c056 100644 --- a/coin/provisioning/common/windows/icu.ps1 +++ b/coin/provisioning/common/windows/icu.ps1 @@ -37,7 +37,7 @@ $version = "53_1" -if(($env:PROCESSOR_ARCHITECTURE -eq "AMD64") -or ($env:PROCESSOR_ARCHITEW6432 -eq "AMD64")) { +if (Is64BitWinHost) { $url_official_2013 = "http://download.qt.io/development_releases/prebuilt/icu/prebuilt/msvc2013/icu_" + $version + "_msvc_2013_64_devel.7z" $url_cache_2013 = "\\ci-files01-hki.intra.qt.io/provisioning/windows/icu_" + $version + "_msvc_2013_64_devel.7z" @@ -46,22 +46,22 @@ if(($env:PROCESSOR_ARCHITECTURE -eq "AMD64") -or ($env:PROCESSOR_ARCHITEW6432 -e $icuPackage_msvc2013_64 = "C:\Windows\Temp\icu-$version-msvc2013_64.7z" if (!(Test-Path C:\Utils\icu_"$version"_msvc_2013_64_devel\)) { - echo "Fetching from URL ..." + Write-Host "Fetching from URL ..." Download $url_official_2013 $url_cache_2013 $icuPackage_msvc2013_64 Verify-Checksum $icuPackage_msvc2013_64 $sha1_2013 Get-ChildItem $icuPackage_msvc2013_64 | % {& "C:\Utils\sevenzip\7z.exe" "x" $_.fullname -o""C:\Utils\icu_"$version"_msvc_2013_64_devel\""} - echo "Cleaning $icuPackage_msvc2013_64..." + Write-Host "Cleaning $icuPackage_msvc2013_64..." Remove-Item -Recurse -Force $icuPackage_msvc2013_64 - echo "ICU MSVC2013 = $version" >> ~\versions.txt + Write-Output "ICU MSVC2013 = $version" >> ~\versions.txt } # FIXME: do we really want to have it per MSVC version? What about MSVC2015? [Environment]::SetEnvironmentVariable("CI_ICU_PATH_MSVC2013", "C:\\Utils\\icu_53_1_msvc_2013_64_devel\\icu53_1", "Machine") # FIXME: do we really want to use the 4.8.2 ICU build? -[Environment]::SetEnvironmentVariable("CI_ICU_PATH_Mingw49", "C:\Utils\icu_53_1_Mingw_builds_4_8_2_posix_seh_64_devel\icu53_1", "Machine") +Set-EnvironmentVariable "CI_ICU_PATH_Mingw49" "C:\Utils\icu_53_1_Mingw_builds_4_8_2_posix_seh_64_devel\icu53_1" } else { @@ -72,15 +72,15 @@ if(($env:PROCESSOR_ARCHITECTURE -eq "AMD64") -or ($env:PROCESSOR_ARCHITEW6432 -e $icuPackage_msvc2013_32 = "C:\Windows\Temp\icu-$version-msvc2013_32.7z" if (!(Test-Path C:\Utils\icu_"$version"_msvc_2013_32_devel\)) { - echo "Fetching from URL ..." + Write-Host "Fetching from URL ..." Download $url_official_2013_32 $url_cache_2013_32 $icuPackage_msvc2013_32 Verify-Checksum $icuPackage_msvc2013_32 $sha1_2013_32 Get-ChildItem $icuPackage_msvc2013_32 | % {& "C:\Utils\sevenzip\7z.exe" "x" $_.fullname -o""C:\Utils\icu_"$version"_msvc_2013_32_devel\""} - echo "Cleaning $icuPackage_msvc2013_32..." + Write-Host "Cleaning $icuPackage_msvc2013_32..." Remove-Item -Recurse -Force $icuPackage_msvc2013_32 - echo "ICU MSVC2013 = $version" >> ~\versions.txt + Write-Output "ICU MSVC2013 = $version" >> ~\versions.txt } # FIXME: do we really want to have it per MSVC version? What about MSVC2015? |