aboutsummaryrefslogtreecommitdiff
path: root/buildtools/packman/win-bootstrap/fetch_file.cmd
diff options
context:
space:
mode:
authorAnton Novoselov <[email protected]>2017-08-01 12:53:38 +0300
committerAnton Novoselov <[email protected]>2017-08-01 12:53:38 +0300
commit236f03c0b9a4982328ed1201978f7f69d192d9b2 (patch)
treee486f2fa39dba203563895541e92c60ed3e25759 /buildtools/packman/win-bootstrap/fetch_file.cmd
parentAdded screens to welcome page (diff)
downloadblast-236f03c0b9a4982328ed1201978f7f69d192d9b2.tar.xz
blast-236f03c0b9a4982328ed1201978f7f69d192d9b2.zip
Blast 1.1 release (windows / linux)
see docs/release_notes.txt for details
Diffstat (limited to 'buildtools/packman/win-bootstrap/fetch_file.cmd')
-rw-r--r--buildtools/packman/win-bootstrap/fetch_file.cmd23
1 files changed, 23 insertions, 0 deletions
diff --git a/buildtools/packman/win-bootstrap/fetch_file.cmd b/buildtools/packman/win-bootstrap/fetch_file.cmd
new file mode 100644
index 0000000..298b6a0
--- /dev/null
+++ b/buildtools/packman/win-bootstrap/fetch_file.cmd
@@ -0,0 +1,23 @@
+:: You need to specify <package-source> <package-name> <package-guid> <target-name> as input to this command
+
+@set PACKAGE_NAME=%2
+@set PACKAGE_GUID=%3
+@set TARGET=%4
+
+@echo Fetching %PACKAGE_NAME% from %1 ...
+
+@if ["%1"] EQU ["s3"] set SOURCE_OPT=-sourceName %PACKAGE_NAME%
+@if ["%1"] EQU ["gtl"] set SOURCE_OPT=-sourceGUID %PACKAGE_GUID%
+
+@powershell -ExecutionPolicy ByPass -NoLogo -NoProfile -File "%~dp0fetch_file_from_%1.ps1" %SOURCE_OPT% -output %TARGET%
+:: A bug in powershell prevents the errorlevel code from being set when using the -File execution option
+:: We must therefore do our own failure analysis, basically make sure the file exists and is larger than 0 bytes:
+@if not exist %TARGET% goto ERROR_DOWNLOAD_FAILED
+@if %~z4==0 goto ERROR_DOWNLOAD_FAILED
+
+@exit /b 0
+
+:ERROR_DOWNLOAD_FAILED
+@echo Failed to download file from %1
+@echo Most likely because endpoint cannot be reached (VPN connection down?)
+@exit /b 1 \ No newline at end of file