-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created/Changed scripts to install/remove local python build
- Loading branch information
1 parent
57bfd48
commit 8fd170c
Showing
2 changed files
with
46 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,41 @@ | ||
@echo off | ||
REM Get latest python build and kits icp path | ||
REM KITS_ICP_PATH is set to ICP directory | ||
REM LATEST_PYTHON is set to a version on genie_python that can be run | ||
REM KITS_ICP_PATH is set to ICP directory | ||
REM LATEST_PYTHON is set to a version on genie_python that can be run | ||
|
||
REM Fetch newest python build from \\isis\inst$\Kits$\CompGroup\ICP\genie_python_3 | ||
REM Use genie_python_install to install it into a temporary directory | ||
REM Need to make sure that after every use of this bat that these variables are undefined and the temp dir is removed | ||
|
||
set "KITS_ICP_PATH=\\isis.cclrc.ac.uk\inst$\Kits$\CompGroup\ICP" | ||
|
||
set "GENIE_DIR=%KITS_ICP_PATH%\genie_python_3" | ||
set "genie_dir=%KITS_ICP_PATH%\genie_python_3" | ||
|
||
if exist "%genie_dir%\LATEST_BUILD.txt" ( | ||
|
||
if exist "%GENIE_DIR%\LATEST_BUILD.txt" ( | ||
for /f %%i in ( %GENIE_DIR%\LATEST_BUILD.txt ) do ( | ||
set LATEST_PYTHON_DIR=%GENIE_DIR%\BUILD-%%i\Python\ | ||
set LATEST_PYTHON=%GENIE_DIR%\BUILD-%%i\Python\python.exe | ||
set LATEST_PYTHON3=%GENIE_DIR%\BUILD-%%i\Python\python3.exe | ||
for /f %%i in ( %genie_dir%\LATEST_BUILD.txt ) do ( | ||
|
||
set LATEST_PYTHON_DIR=%tmp%\Python_Build_%%i | ||
mkdir %LATEST_PYTHON_DIR% | ||
|
||
CALL %genie_dir%\BUILD-%%i\genie_python_install.bat %LATEST_PYTHON_DIR% | ||
|
||
set LATEST_PYTHON=%LATEST_PYTHON_DIR%\python.exe | ||
set LATEST_PYTHON3=%LATEST_PYTHON_DIR%\python3.exe | ||
|
||
) | ||
|
||
) else ( | ||
|
||
@echo Could not access LATEST_BUILD.txt | ||
goto ERROR | ||
|
||
) | ||
|
||
@echo LATEST PYTHON: %LATEST_PYTHON% | ||
rem @echo LATEST PYTHON: %LATEST_PYTHON% | ||
|
||
exit /b 0 | ||
|
||
:ERROR | ||
@echo define_latest_genie_python failed | ||
exit /b 1 | ||
exit /b 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@echo off | ||
|
||
if "%~1"=="" ( | ||
echo No path provided as the first parameter. | ||
exit /b 1 | ||
) | ||
|
||
set substring=Python_Build_ | ||
set path=%~1 | ||
set modified_path=%path:%substring%=% | ||
|
||
if "%path%" neq "%modified_path%" ( | ||
|
||
set LATEST_PYTHON_DIR= | ||
set LATEST_PYTHON= | ||
set LATEST_PYTHON3= | ||
|
||
RMDIR /S /Q %path% | ||
|
||
) else ( | ||
echo Could not find the specified path: %path%. | ||
) |