aboutsummaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
Diffstat (limited to 'buildtools')
-rwxr-xr-xbuildtools/build_platform_deps.xml1
-rwxr-xr-xbuildtools/cmake_projects_linux_ue4_crosscompile.bat4
-rwxr-xr-xbuildtools/packman/packman74
-rwxr-xr-xbuildtools/packman/packman.cmd41
-rwxr-xr-xbuildtools/packman/packman_config.txt3
-rwxr-xr-xbuildtools/packman/packmanapi.py16
-rwxr-xr-xbuildtools/packman/win-bootstrap/configure.bat104
-rwxr-xr-xbuildtools/packman/win-bootstrap/fetch_file_from_s3.cmd19
-rwxr-xr-xbuildtools/packman/win-bootstrap/fetch_file_from_s3.ps160
-rwxr-xr-xbuildtools/packman/win-bootstrap/fetch_file_from_url.ps137
-rwxr-xr-xbuildtools/packman/win-bootstrap/generate_temp_file_name.ps12
-rwxr-xr-xbuildtools/packman/win-bootstrap/install_package.py39
-rwxr-xr-xbuildtools/packman5/config.packman.xml2
-rwxr-xr-xbuildtools/packman5/packman49
-rwxr-xr-xbuildtools/packman5/packman.cmd2
-rwxr-xr-xbuildtools/packman5/win-bootstrap/configure.bat64
-rwxr-xr-xbuildtools/packman5/win-bootstrap/fetch_file_from_s3.cmd2
-rwxr-xr-xbuildtools/packman5/win-bootstrap/fetch_file_from_s3.ps12
-rw-r--r--buildtools/packman5/win-bootstrap/generate_temp_folder.ps17
19 files changed, 94 insertions, 434 deletions
diff --git a/buildtools/build_platform_deps.xml b/buildtools/build_platform_deps.xml
index f30ba7c..3c85540 100755
--- a/buildtools/build_platform_deps.xml
+++ b/buildtools/build_platform_deps.xml
@@ -8,7 +8,6 @@
</dependency>
<dependency name="CMakeModules">
<package name="CMakeModules" version="1.1.0"/>
- <package name="CMakeModules-xboxone" version="1.0.6.1" platforms="win.durango"/>
</dependency>
<dependency name="UE4LinuxToolChainV8">
<package name="UE4LinuxToolchainV8" version="1.0.0.0" platforms="win.linux-UE4-cross"/>
diff --git a/buildtools/cmake_projects_linux_ue4_crosscompile.bat b/buildtools/cmake_projects_linux_ue4_crosscompile.bat
index 6c94800..cefdcc7 100755
--- a/buildtools/cmake_projects_linux_ue4_crosscompile.bat
+++ b/buildtools/cmake_projects_linux_ue4_crosscompile.bat
@@ -43,8 +43,8 @@ echo %CMAKE_CMD_LINE_PARAMS%
if not exist %BLAST_ROOT_DIR%/bin/linux64-UE4 mkdir %BLAST_ROOT_DIR%/bin/linux64-UE4
::Seems like there are no checked or profile Linux PhysX Libs
-FOR %%Z IN (debug, release, checked, profile) DO (
-::FOR %%Z IN (debug, release) DO (
+::FOR %%Z IN (debug, release, checked, profile) DO (
+FOR %%Z IN (debug, release) DO (
SET CMAKE_OUTPUT_DIR=%BLAST_ROOT_DIR%\compiler\linux64-%%Z-UE4\
IF EXIST !CMAKE_OUTPUT_DIR! rmdir /S /Q !CMAKE_OUTPUT_DIR!
mkdir !CMAKE_OUTPUT_DIR!
diff --git a/buildtools/packman/packman b/buildtools/packman/packman
deleted file mode 100755
index 124a92d..0000000
--- a/buildtools/packman/packman
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/bin/bash
-
-PM_PACKMAN_VERSION=4.0.1
-
-# Specify where configuration file could exist
-export PM_CONFIG_PATH=$(dirname ${BASH_SOURCE})/packman_config.txt
-
-# The packages root may already be configured by the user
-if [ -z "$PM_PACKAGES_ROOT" ]; then
- # Set variable permanently using .profile for this user
- echo "export PM_PACKAGES_ROOT=\$HOME/packman-repo" >> ~/.profile
- # Set variable temporarily in this process so that the following execution will work
- export PM_PACKAGES_ROOT="${HOME}/packman-repo"
-fi
-
-# Ensure the packages root path exists:
-if [ ! -d "$PM_PACKAGES_ROOT" ]; then
- echo "Creating packman packages repository at $PM_PACKAGES_ROOT"
- mkdir -p "$PM_PACKAGES_ROOT"
-fi
-
-# The packman module may be externally configured
-if [ -z "$PM_MODULE_EXT" ]; then
- PM_MODULE_DIR="$PM_PACKAGES_ROOT/packman/$PM_PACKMAN_VERSION-common"
- export PM_MODULE="$PM_MODULE_DIR/packman.py"
-else
- export PM_MODULE="$PM_MODULE_EXT"
-fi
-
-fetch_file_from_s3()
-{
- SOURCE=$1
- SOURCE_URL=http://packman.s3.amazonaws.com/$SOURCE
- TARGET=$2
- echo "Fetching $SOURCE from S3 ..."
- if command -v wget >/dev/null 2>&1; then
- wget --quiet -O$TARGET $SOURCE_URL
- else
- curl -o $TARGET $SOURCE_URL -s -S
- fi
-}
-
-# Ensure the packman package exists:
-if [ ! -f "$PM_MODULE" ]; then
- PM_MODULE_PACKAGE="packman@$PM_PACKMAN_VERSION-common.zip"
- TARGET="/tmp/$PM_MODULE_PACKAGE"
- # We always fetch packman from S3:
- fetch_file_from_s3 $PM_MODULE_PACKAGE $TARGET
- if [ "$?" -eq "0" ]; then
- echo "Unpacking ..."
- mkdir -p "$PM_MODULE_DIR"
- unzip -q $TARGET -d "$PM_MODULE_DIR"
- rm $TARGET
- else
- echo "Failure while fetching packman module from S3!"
- exit 1
- fi
-fi
-
-# Generate temporary file name for environment variables:
-PM_VAR_PATH=`mktemp -u -t tmp.XXXXX.$$.pmvars`
-
-python "$PM_MODULE" $* --var-path="$PM_VAR_PATH"
-
-# Export the variables if the file was used and remove the file:
-if [ -f "$PM_VAR_PATH" ]; then
- while read -r line
- do
- if [ ${#line} -gt 0 ]; then
- export "$line"
- fi
- done < "$PM_VAR_PATH"
- rm -f "$PM_VAR_PATH"
-fi
diff --git a/buildtools/packman/packman.cmd b/buildtools/packman/packman.cmd
deleted file mode 100755
index fefdc4f..0000000
--- a/buildtools/packman/packman.cmd
+++ /dev/null
@@ -1,41 +0,0 @@
-:: Reset errorlevel status so we are not inheriting this state from the calling process:
-@call :RESET_ERROR
-:: You can remove the call below if you do your own manual configuration of the dev machines
-@call "%~dp0\win-bootstrap\configure.bat"
-@if errorlevel 1 exit /b 1
-:: Everything below is mandatory
-@if not defined PM_PYTHON goto :PYTHON_ENV_ERROR
-@if not defined PM_MODULE goto :MODULE_ENV_ERROR
-
-:: Generate temporary path for variable file
-:TEMP_VAR_PATH_LOOP
-@set "PM_VAR_PATH=%tmp%\tmp.%RANDOM%.pmvars"
-@if exist "%PM_VAR_PATH%" goto :TEMP_VAR_PATH_LOOP
-
-@"%PM_PYTHON%" "%PM_MODULE%" %* --var-path="%PM_VAR_PATH%"
-@if errorlevel 1 goto :eof
-
-:: Marshall environment variables into the current environment if they have been generated and remove temporary file
-@if exist "%PM_VAR_PATH%" (
- @for /F "usebackq tokens=*" %%A in ("%PM_VAR_PATH%") do @set "%%A"
- @if errorlevel 1 goto :VAR_ERROR
- @del /F "%PM_VAR_PATH%"
-)
-@set PM_VAR_PATH=
-@goto :eof
-
-:: Subroutines below
-:PYTHON_ENV_ERROR
-@echo User environment variable PM_PYTHON is not set! Please configure machine for packman or call configure.bat.
-@exit /b 1
-
-:MODULE_ENV_ERROR
-@echo User environment variable PM_MODULE is not set! Please configure machine for packman or call configure.bat.
-@exit /b 1
-
-:VAR_ERROR
-@echo Error while processing and setting environment variables!
-@exit /b 1
-
-:RESET_ERROR
-@exit /b 0 \ No newline at end of file
diff --git a/buildtools/packman/packman_config.txt b/buildtools/packman/packman_config.txt
deleted file mode 100755
index 2741ed2..0000000
--- a/buildtools/packman/packman_config.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-PM_PACKAGES_SOURCE=s3
-PM_S3_READ_KEY_ID=AKIAJHPSPBMWMTZS6TJA
-PM_S3_READ_SECRET_KEY=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
diff --git a/buildtools/packman/packmanapi.py b/buildtools/packman/packmanapi.py
deleted file mode 100755
index 76e20d0..0000000
--- a/buildtools/packman/packmanapi.py
+++ /dev/null
@@ -1,16 +0,0 @@
-import os
-import sys
-
-
-def get_packman_module_dir():
- root_dir = os.environ['PM_PACKAGES_ROOT']
- common_dir = '4.0.1-common'
- module_dir = os.path.join(root_dir, 'packman', common_dir)
- return module_dir
-
-
-sys.path.insert(0, get_packman_module_dir())
-from packman import pack
-from packman import push
-from packager import get_package_filename
-from packager import create_package_from_file_list
diff --git a/buildtools/packman/win-bootstrap/configure.bat b/buildtools/packman/win-bootstrap/configure.bat
deleted file mode 100755
index 2533d63..0000000
--- a/buildtools/packman/win-bootstrap/configure.bat
+++ /dev/null
@@ -1,104 +0,0 @@
-@set PM_PACKMAN_VERSION=4.0.1
-
-:: Specify where config file could exist
-@set PM_CONFIG_PATH=%~dp0..\packman_config.txt
-
-:: The external root may already be configured and we should do minimal work in that case
-@if defined PM_PACKAGES_ROOT goto ENSURE_DIR
-
-:: If the folder isn't set we assume that the best place for it is on the drive that we are currently
-:: running from
-@set PM_DRIVE=%CD:~0,2%
-
-@set PM_PACKAGES_ROOT=%PM_DRIVE%\packman-repo
-
-:: We use *setx* here so that the variable is persisted in the user environment
-@echo Setting user environment variable PM_PACKAGES_ROOT to %PM_PACKAGES_ROOT%
-@setx PM_PACKAGES_ROOT %PM_PACKAGES_ROOT%
-@if errorlevel 1 goto ERROR
-
-:: The above doesn't work properly from a build step in VisualStudio because a separate process is
-:: spawned for it so it will be lost for subsequent compilation steps - VisualStudio must
-:: be launched from a new process. We catch this odd-ball case here:
-@if defined VSLANG goto ERROR_IN_VS_WITH_NO_ROOT_DEFINED
-
-:: Check for the directory that we need. Note that mkdir will create any directories
-:: that may be needed in the path
-:ENSURE_DIR
-@if not exist "%PM_PACKAGES_ROOT%" (
- @echo Creating directory %PM_PACKAGES_ROOT%
- @mkdir "%PM_PACKAGES_ROOT%"
- @if errorlevel 1 goto ERROR_MKDIR_PACKAGES_ROOT
-)
-
-:: The Python interpreter may already be externally configured
-@if defined PM_PYTHON_EXT (
- @set PM_PYTHON=%PM_PYTHON_EXT%
- @goto PACKMAN
-)
-
-@set PM_PYTHON_DIR=%PM_PACKAGES_ROOT%\python\2.7.6-windows-x86
-@set PM_PYTHON=%PM_PYTHON_DIR%\python.exe
-
-@if exist "%PM_PYTHON%" goto PACKMAN
-
-@for /f "delims=" %%a in ('powershell -ExecutionPolicy ByPass -NoLogo -NoProfile -File "%~dp0\generate_temp_file_name.ps1"') do @set TEMP_FILE_NAME=%%a
-@set TARGET=%TEMP_FILE_NAME%.exe
-@call "%~dp0fetch_file_from_s3.cmd" %PM_PYTHON_PACKAGE% %TARGET%
-@if errorlevel 1 goto ERROR
-
-@echo Unpacking ...
-@%TARGET% -o"%PM_PYTHON_DIR%" -y 1> nul
-@if errorlevel 1 goto ERROR
-
-@del %TARGET%
-
-:PACKMAN
-:: The packman module may already be externally configured
-@if defined PM_MODULE_EXT (
- @set PM_MODULE=%PM_MODULE_EXT%
- @goto END
-)
-
-@set PM_MODULE_DIR=%PM_PACKAGES_ROOT%\packman\%PM_PACKMAN_VERSION%-common
-@set PM_MODULE=%PM_MODULE_DIR%\packman.py
-
-@if exist "%PM_MODULE%" goto END
-
-@set PM_MODULE_PACKAGE=packman@%PM_PACKMAN_VERSION%-common.zip
-@for /f "delims=" %%a in ('powershell -ExecutionPolicy ByPass -NoLogo -NoProfile -File "%~dp0\generate_temp_file_name.ps1"') do @set TEMP_FILE_NAME=%%a
-@set TARGET=%TEMP_FILE_NAME%
-@call "%~dp0fetch_file_from_s3.cmd" %PM_MODULE_PACKAGE% %TARGET%
-@if errorlevel 1 goto ERROR
-
-@echo Unpacking ...
-@"%PM_PYTHON%" "%~dp0\install_package.py" %TARGET% "%PM_MODULE_DIR%"
-@if errorlevel 1 goto ERROR
-
-@del %TARGET%
-
-@goto END
-
-:ERROR_IN_VS_WITH_NO_ROOT_DEFINED
-@echo The above is a once-per-computer operation. Unfortunately VisualStudio cannot pick up environment change
-@echo unless *VisualStudio is RELAUNCHED*.
-@echo NOTE: If you are launching VisualStudio from command line or command line utility make sure
-@echo you have a fresh environment (relaunch the command line or utility).
-@echo.
-@exit /B 1
-
-:ERROR_MKDIR_PACKAGES_ROOT
-@echo Failed to automatically create packman packages repo at %PM_PACKAGES_ROOT%.
-@echo Please set a location explicitly that packman has permission to write to, by issuing:
-@echo.
-@echo setx PM_PACKAGES_ROOT {path-you-choose-for-storing-packman-packages-locally}
-@echo.
-@echo Then launch a new command console for the changes to take effect and run packman command again.
-@exit /B 1
-
-:ERROR
-@echo !!! Failure while configuring local machine :( !!!
-@exit /B 1
-
-:END
diff --git a/buildtools/packman/win-bootstrap/fetch_file_from_s3.cmd b/buildtools/packman/win-bootstrap/fetch_file_from_s3.cmd
deleted file mode 100755
index 7f91a47..0000000
--- a/buildtools/packman/win-bootstrap/fetch_file_from_s3.cmd
+++ /dev/null
@@ -1,19 +0,0 @@
-:: You need to specify <package-name> <target-name> as input to this command
-
-@set PACKAGE_NAME=%1
-@set TARGET=%2
-
-@echo Fetching %PACKAGE_NAME% from s3 ...
-
-@powershell -ExecutionPolicy ByPass -NoLogo -NoProfile -File "%~dp0fetch_file_from_s3.ps1" -sourceName %PACKAGE_NAME% -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 %~z2==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
diff --git a/buildtools/packman/win-bootstrap/fetch_file_from_s3.ps1 b/buildtools/packman/win-bootstrap/fetch_file_from_s3.ps1
deleted file mode 100755
index 132fe0d..0000000
--- a/buildtools/packman/win-bootstrap/fetch_file_from_s3.ps1
+++ /dev/null
@@ -1,60 +0,0 @@
-param(
-[Parameter(Mandatory=$true)][string]$sourceName=$null,
-[string]$output="out.exe"
-)
-$source = "http://packman.s3.amazonaws.com/" + $sourceName
-$filename = $output
-
-$triesLeft = 3
-
-do
-{
- $triesLeft -= 1
- $req = [System.Net.httpwebrequest]::Create($source)
- $req.cookiecontainer = New-Object System.net.CookieContainer
-
- try
- {
- Write-Host "Connecting to S3 ..."
- $res = $req.GetResponse()
- if($res.StatusCode -eq "OK") {
- Write-Host "Downloading ..."
- [int]$goal = $res.ContentLength
- $reader = $res.GetResponseStream()
- $writer = new-object System.IO.FileStream $fileName, "Create"
- [byte[]]$buffer = new-object byte[] 4096
- [int]$total = [int]$count = 0
- do
- {
- $count = $reader.Read($buffer, 0, $buffer.Length);
- $writer.Write($buffer, 0, $count);
- $total += $count
- if($goal -gt 0) {
- Write-Progress "Downloading $url" "Saving $total of $goal" -id 0 -percentComplete (($total/$goal)*100)
- } else {
- Write-Progress "Downloading $url" "Saving $total bytes..." -id 0
- }
- } while ($count -gt 0)
-
- $triesLeft = 0
- }
- }
- catch
- {
- Write-Host "Error connecting to S3!"
- Write-Host $_.Exception|format-list -force
- }
- finally
- {
- if ($reader)
- {
- $reader.Close()
- }
- if ($writer)
- {
- $writer.Flush()
- $writer.Close()
- }
- }
-} while ($triesLeft -gt 0)
-
diff --git a/buildtools/packman/win-bootstrap/fetch_file_from_url.ps1 b/buildtools/packman/win-bootstrap/fetch_file_from_url.ps1
deleted file mode 100755
index b9cb23c..0000000
--- a/buildtools/packman/win-bootstrap/fetch_file_from_url.ps1
+++ /dev/null
@@ -1,37 +0,0 @@
-param(
-[Parameter(Mandatory=$true)][string]$sourceUrl=$null,
-[Parameter(Mandatory=$true)][string]$output=$null
-)
-$source = $sourceUrl
-$filename = $output
-
-$req = [System.Net.httpwebrequest]::Create($source)
-$req.cookiecontainer = New-Object System.net.CookieContainer
-
-Write-Host "Connecting to $source ..."
-$res = $req.GetResponse()
-
-if($res.StatusCode -eq "OK") {
- Write-Host "Downloading ..."
- [int]$goal = $res.ContentLength
- $reader = $res.GetResponseStream()
- $writer = new-object System.IO.FileStream $fileName, "Create"
- [byte[]]$buffer = new-object byte[] 4096
- [int]$total = [int]$count = 0
- do
- {
- $count = $reader.Read($buffer, 0, $buffer.Length);
- $writer.Write($buffer, 0, $count);
- $total += $count
- if($goal -gt 0) {
- Write-Progress "Downloading $url" "Saving $total of $goal" -id 0 -percentComplete (($total/$goal)*100)
- } else {
- Write-Progress "Downloading $url" "Saving $total bytes..." -id 0
- }
- } while ($count -gt 0)
-
- $reader.Close()
- $writer.Flush()
- $writer.Close()
-}
-
diff --git a/buildtools/packman/win-bootstrap/generate_temp_file_name.ps1 b/buildtools/packman/win-bootstrap/generate_temp_file_name.ps1
deleted file mode 100755
index a8c9c1b..0000000
--- a/buildtools/packman/win-bootstrap/generate_temp_file_name.ps1
+++ /dev/null
@@ -1,2 +0,0 @@
-$out = [System.IO.Path]::GetTempFileName()
-Write-Host $out \ No newline at end of file
diff --git a/buildtools/packman/win-bootstrap/install_package.py b/buildtools/packman/win-bootstrap/install_package.py
deleted file mode 100755
index 3aa294e..0000000
--- a/buildtools/packman/win-bootstrap/install_package.py
+++ /dev/null
@@ -1,39 +0,0 @@
-import logging
-import zipfile
-import tempfile
-import sys
-import shutil
-
-__author__ = 'hfannar'
-logging.basicConfig(level=logging.WARNING, format="%(message)s")
-logger = logging.getLogger('install_package')
-
-
-class TemporaryDirectory:
- def __init__(self):
- self.path = None
-
- def __enter__(self):
- self.path = tempfile.mkdtemp()
- return self.path
-
- def __exit__(self, type, value, traceback ):
- # Remove temporary data created
- shutil.rmtree(self.path)
-
-
-def install_package(package_src_path, package_dst_path):
- with zipfile.ZipFile(package_src_path, allowZip64=True) as zip_file, TemporaryDirectory() as temp_dir:
- zip_file.extractall(temp_dir)
- # Recursively copy (temp_dir will be automatically cleaned up on exit)
- try:
- # Recursive copy is needed because both package name and version folder could be missing in
- # target directory:
- shutil.copytree(temp_dir, package_dst_path)
- except OSError, exc:
- logger.warning("Directory %s already present, packaged installation aborted" % package_dst_path)
- else:
- logger.info("Package successfully installed to %s" % package_dst_path)
-
-
-install_package(sys.argv[1], sys.argv[2]) \ No newline at end of file
diff --git a/buildtools/packman5/config.packman.xml b/buildtools/packman5/config.packman.xml
index 6a6da46..a3b89aa 100755
--- a/buildtools/packman5/config.packman.xml
+++ b/buildtools/packman5/config.packman.xml
@@ -1,3 +1,3 @@
<config remotes="cloudfront">
<remote name="cloudfront" packageLocation="d4i3qtqj3r0z5.cloudfront.net/${name}@${version}" type="https" />
- </config> \ No newline at end of file
+</config> \ No newline at end of file
diff --git a/buildtools/packman5/packman b/buildtools/packman5/packman
index c16a2a7..a2fb94f 100755
--- a/buildtools/packman5/packman
+++ b/buildtools/packman5/packman
@@ -1,15 +1,27 @@
#!/bin/bash
-PM_PACKMAN_VERSION=5.2.1
+PM_PACKMAN_VERSION=5.7.2
# Specify where packman command exists
export PM_INSTALL_PATH=$(dirname ${BASH_SOURCE})
+add_packages_root_to_file()
+{
+ FILE_PATH=$1
+ if [ -f "$FILE_PATH" ]; then
+ if ! grep -Fq "PM_PACKAGES_ROOT" $FILE_PATH ; then
+ echo "Adjusting $FILE_PATH"
+ echo -e "export PM_PACKAGES_ROOT=\$HOME/packman-repo\n" >> $FILE_PATH
+ fi
+ fi
+}
+
# The packages root may already be configured by the user
if [ -z "$PM_PACKAGES_ROOT" ]; then
- # Set variable permanently using .profile for this user
- echo "export PM_PACKAGES_ROOT=\$HOME/packman-repo" >> ~/.profile
- # Set variable temporarily in this process so that the following execution will work
+ # Set variable permanently using .profile for this user (if exists)
+ add_packages_root_to_file ~/.profile
+ add_packages_root_to_file ~/.bashrc
+ # Set variable temporarily in this process so that the following execution will work
export PM_PACKAGES_ROOT="${HOME}/packman-repo"
fi
@@ -20,17 +32,17 @@ if [ ! -d "$PM_PACKAGES_ROOT" ]; then
fi
# The packman module may be externally configured
-if [ -z "$PM_MODULE_EXT" ]; then
+if [ -z "$PM_MODULE_DIR_EXT" ]; then
PM_MODULE_DIR="$PM_PACKAGES_ROOT/packman-common/$PM_PACKMAN_VERSION"
- export PM_MODULE="$PM_MODULE_DIR/packman.py"
else
- export PM_MODULE="$PM_MODULE_EXT"
+ PM_MODULE_DIR="$PM_MODULE_DIR_EXT"
fi
+export PM_MODULE="$PM_MODULE_DIR/packman.py"
fetch_file_from_s3()
{
SOURCE=$1
- SOURCE_URL=http://packman.s3.amazonaws.com/$SOURCE
+ SOURCE_URL=http://packman-bootstrap.s3.amazonaws.com/$SOURCE
TARGET=$2
echo "Fetching $SOURCE from S3 ..."
if command -v wget >/dev/null 2>&1; then
@@ -67,20 +79,23 @@ else
fi
# Ensure 7za package exists:
-PM_7za_VERSION=16.02.2
-export PM_7za_PATH="$PM_PACKAGES_ROOT/chk/7za/$PM_7za_VERSION"
-if [ ! -f "$PM_7za_PATH" ]; then
- $PM_PYTHON "$PM_MODULE" install 7za $PM_7za_VERSION -r packman:cloudfront
- if [ "$?" -ne 0 ]; then
- echo "Failure while installing required 7za package"
- exit 1
+PM_7za_VERSION=16.02.4
+export PM_7za_PATH="$PM_PACKAGES_ROOT/7za/$PM_7za_VERSION"
+if [ ! -d "$PM_7za_PATH" ]; then
+ export PM_7za_PATH="$PM_PACKAGES_ROOT/chk/7za/$PM_7za_VERSION"
+ if [ ! -d "$PM_7za_PATH" ]; then
+ $PM_PYTHON -s -u -E "$PM_MODULE" pull "$PM_MODULE_DIR/deps.packman.xml"
+ if [ "$?" -ne 0 ]; then
+ echo "Failure while installing required 7za package"
+ exit 1
+ fi
fi
fi
# Generate temporary file name for environment variables:
-PM_VAR_PATH=`mktemp -u -t tmp.XXXXX.$$.pmvars`
+PM_VAR_PATH=`mktemp -u -t tmp.$$.pmvars.XXXXXX`
-$PM_PYTHON -u "$PM_MODULE" $* --var-path="$PM_VAR_PATH"
+$PM_PYTHON -s -u -E "$PM_MODULE" "$@" --var-path="$PM_VAR_PATH"
exit_code=$?
# Export the variables if the file was used and remove the file:
if [ -f "$PM_VAR_PATH" ]; then
diff --git a/buildtools/packman5/packman.cmd b/buildtools/packman5/packman.cmd
index ae7b495..b06f6dc 100755
--- a/buildtools/packman5/packman.cmd
+++ b/buildtools/packman5/packman.cmd
@@ -11,7 +11,7 @@
@for /f "delims=" %%a in ('powershell -ExecutionPolicy ByPass -NoLogo -NoProfile ^
-File "%~dp0win-bootstrap\generate_temp_file_name.ps1"') do @set PM_VAR_PATH=%%a
-@"%PM_PYTHON%" -u "%PM_MODULE%" %* --var-path="%PM_VAR_PATH%"
+@"%PM_PYTHON%" -s -u -E "%PM_MODULE%" %* --var-path="%PM_VAR_PATH%"
@if errorlevel 1 goto :eof
:: Marshall environment variables into the current environment if they have been generated and remove temporary file
diff --git a/buildtools/packman5/win-bootstrap/configure.bat b/buildtools/packman5/win-bootstrap/configure.bat
index a38f697..223a839 100755
--- a/buildtools/packman5/win-bootstrap/configure.bat
+++ b/buildtools/packman5/win-bootstrap/configure.bat
@@ -1,4 +1,4 @@
-@set PM_PACKMAN_VERSION=5.2.1
+@set PM_PACKMAN_VERSION=5.7.2
:: Specify where packman command is rooted
@set PM_INSTALL_PATH=%~dp0..
@@ -45,31 +45,54 @@
@goto PACKMAN
)
-@set PM_PYTHON_DIR=%PM_PACKAGES_ROOT%\python\2.7.6-windows-x86
+@set PM_PYTHON_VERSION=2.7.14-windows-x86_32
+@set PM_PYTHON_BASE_DIR=%PM_PACKAGES_ROOT%\python
+@set PM_PYTHON_DIR=%PM_PYTHON_BASE_DIR%\%PM_PYTHON_VERSION%
@set PM_PYTHON=%PM_PYTHON_DIR%\python.exe
@if exist "%PM_PYTHON%" goto PACKMAN
+@if not exist "%PM_PYTHON_BASE_DIR%" call :CREATE_PYTHON_BASE_DIR
+@set PM_PYTHON_PACKAGE=python@%PM_PYTHON_VERSION%.cab
@for /f "delims=" %%a in ('powershell -ExecutionPolicy ByPass -NoLogo -NoProfile -File "%~dp0\generate_temp_file_name.ps1"') do @set TEMP_FILE_NAME=%%a
-@set TARGET=%TEMP_FILE_NAME%.exe
+@set TARGET=%TEMP_FILE_NAME%.zip
@call "%~dp0fetch_file_from_s3.cmd" %PM_PYTHON_PACKAGE% "%TARGET%"
@if errorlevel 1 goto ERROR
-@echo Unpacking ...
-@"%TARGET%" -o"%PM_PYTHON_DIR%" -y 1> nul
-@if errorlevel 1 goto ERROR
-
+@for /f "delims=" %%a in ('powershell -ExecutionPolicy ByPass -NoLogo -NoProfile -File "%~dp0\generate_temp_folder.ps1" -parentPath "%PM_PYTHON_BASE_DIR%"') do @set TEMP_FOLDER_NAME=%%a
+@echo Unpacking Python interpreter ...
+@expand -F:* "%TARGET%" "%TEMP_FOLDER_NAME%" 1> nul
@del "%TARGET%"
+:: Failure during extraction to temp folder name, need to clean up and abort
+@if errorlevel 1 (
+ @call :CLEAN_UP_TEMP_FOLDER
+ @goto ERROR
+)
+
+:: If python has now been installed by a concurrent process we need to clean up and then continue
+@if exist "%PM_PYTHON%" (
+ @call :CLEAN_UP_TEMP_FOLDER
+ @goto PACKMAN
+) else (
+ @if exist "%PM_PYTHON_DIR%" ( @rd /s /q "%PM_PYTHON_DIR%" > nul )
+)
+
+:: Perform atomic rename
+@rename "%TEMP_FOLDER_NAME%" "%PM_PYTHON_VERSION%" 1> nul
+:: Failure during move, need to clean up and abort
+@if errorlevel 1 (
+ @call :CLEAN_UP_TEMP_FOLDER
+ @goto ERROR
+)
:PACKMAN
:: The packman module may already be externally configured
-@if defined PM_MODULE_EXT (
- @set PM_MODULE=%PM_MODULE_EXT%
- @goto ENSURE_7za
+@if defined PM_MODULE_DIR_EXT (
+ @set PM_MODULE_DIR=%PM_MODULE_DIR_EXT%
+) else (
+ @set PM_MODULE_DIR=%PM_PACKAGES_ROOT%\packman-common\%PM_PACKMAN_VERSION%
)
-@set PM_MODULE_DIR=%PM_PACKAGES_ROOT%\packman-common\%PM_PACKMAN_VERSION%
@set PM_MODULE=%PM_MODULE_DIR%\packman.py
@if exist "%PM_MODULE%" goto ENSURE_7ZA
@@ -81,17 +104,19 @@
@if errorlevel 1 goto ERROR
@echo Unpacking ...
-@"%PM_PYTHON%" "%~dp0\install_package.py" "%TARGET%" "%PM_MODULE_DIR%"
+@"%PM_PYTHON%" -s -u -E "%~dp0\install_package.py" "%TARGET%" "%PM_MODULE_DIR%"
@if errorlevel 1 goto ERROR
@del "%TARGET%"
:ENSURE_7ZA
-@set PM_7Za_VERSION=16.02.2
+@set PM_7Za_VERSION=16.02.4
+@set PM_7Za_PATH=%PM_PACKAGES_ROOT%\7za\%PM_7ZA_VERSION%
+@if exist "%PM_7Za_PATH%" goto END
@set PM_7Za_PATH=%PM_PACKAGES_ROOT%\chk\7za\%PM_7ZA_VERSION%
@if exist "%PM_7Za_PATH%" goto END
-@"%PM_PYTHON%" "%PM_MODULE%" install 7za %PM_7za_VERSION% -r packman:cloudfront
+@"%PM_PYTHON%" -s -u -E "%PM_MODULE%" pull "%PM_MODULE_DIR%\deps.packman.xml"
@if errorlevel 1 goto ERROR
@goto END
@@ -109,4 +134,13 @@
@echo !!! Failure while configuring local machine :( !!!
@exit /B 1
+:CLEAN_UP_TEMP_FOLDER
+@rd /S /Q "%TEMP_FOLDER_NAME%"
+@exit /B
+
+:CREATE_PYTHON_BASE_DIR
+:: We ignore errors and clean error state - if two processes create the directory one will fail which is fine
+@md "%PM_PYTHON_BASE_DIR%" > nul 2>&1
+@exit /B 0
+
:END
diff --git a/buildtools/packman5/win-bootstrap/fetch_file_from_s3.cmd b/buildtools/packman5/win-bootstrap/fetch_file_from_s3.cmd
index 90f717a..4e31293 100755
--- a/buildtools/packman5/win-bootstrap/fetch_file_from_s3.cmd
+++ b/buildtools/packman5/win-bootstrap/fetch_file_from_s3.cmd
@@ -3,7 +3,7 @@
@set PACKAGE_NAME=%1
@set TARGET_PATH=%2
-@echo Fetching %PACKAGE_NAME% from S3 ...
+@echo Fetching %PACKAGE_NAME% from packman-bootstrap over HTTP ...
@powershell -ExecutionPolicy ByPass -NoLogo -NoProfile -File "%~dp0fetch_file_from_s3.ps1" -sourceName %PACKAGE_NAME% ^
-output %TARGET_PATH%
diff --git a/buildtools/packman5/win-bootstrap/fetch_file_from_s3.ps1 b/buildtools/packman5/win-bootstrap/fetch_file_from_s3.ps1
index 132fe0d..96db7f2 100755
--- a/buildtools/packman5/win-bootstrap/fetch_file_from_s3.ps1
+++ b/buildtools/packman5/win-bootstrap/fetch_file_from_s3.ps1
@@ -2,7 +2,7 @@ param(
[Parameter(Mandatory=$true)][string]$sourceName=$null,
[string]$output="out.exe"
)
-$source = "http://packman.s3.amazonaws.com/" + $sourceName
+$source = "http://packman-bootstrap.s3.amazonaws.com/" + $sourceName
$filename = $output
$triesLeft = 3
diff --git a/buildtools/packman5/win-bootstrap/generate_temp_folder.ps1 b/buildtools/packman5/win-bootstrap/generate_temp_folder.ps1
new file mode 100644
index 0000000..b24a654
--- /dev/null
+++ b/buildtools/packman5/win-bootstrap/generate_temp_folder.ps1
@@ -0,0 +1,7 @@
+param(
+[Parameter(Mandatory=$true)][string]$parentPath=$null
+)
+[string] $name = [System.Guid]::NewGuid()
+$out = Join-Path $parentPath $name
+New-Item -ItemType Directory -Path ($out) | Out-Null
+Write-Host $out