<commit_before>@setlocal
@IF NOT EXIST %mesa%\mesa-dist-win\buildinfo md %mesa%\mesa-dist-win\buildinfo
@set /p enableenvdump=Do you want to dump build environment information to a text file (y/n):
@echo.
@IF /I NOT "%enableenvdump%"=="y" GOTO skipenvdump
@echo Dumping build environment information. This will take a short while...
@echo.
@IF %toolchain%==gcc echo Build environment>%mesa%\mesa-dist-win\buildinfo\mingw.txt
@IF %toolchain%==gcc echo ----------------->>%mesa%\mesa-dist-win\buildinfo\mingw.txt
@IF %toolchain%==msvc echo Build environment>%mesa%\mesa-dist-win\buildinfo\msvc.txt
@IF %toolchain%==msvc echo ----------------->>%mesa%\mesa-dist-win\buildinfo\msvc.txt

@rem Dump Windows version
@FOR /F "USEBACKQ tokens=4" %%a IN (`ver`) DO @set winver=%%a
@set winver=%winver:~0,-1%
@IF %toolchain%==msvc FOR /F "USEBACKQ" %%a IN (`%pythonloc% -c "print('.'.join('%winver%'.split('.')[:3]))"`) do @set winver=%%a
@IF %toolchain%==gcc echo /usr/bin/python2 -c "print('.'.join('%winver%'.split('.')[:3]))">%mesa%\mesa-dist-win\buildinfo\temp.sh
@IF %toolchain%==gcc FOR /F "USEBACKQ" %%a IN (`%msysloc%\usr\bin\bash --login %mesa%\mesa-dist-win\buildinfo\temp.sh`) do @set winver=%%a
@IF %toolchain%==gcc del %mesa%\mesa-dist-win\buildinfo\temp.sh
@IF %toolchain%==gcc echo Windows %winver%>>%mesa%\mesa-dist-win\buildinfo\mingw.txt
@IF %toolchain%==msvc echo Windows %winver%>>%mesa%\mesa-dist-win\buildinfo\msvc.txt

@rem Dump Resource Hacker version
@IF %rhstate%==1 SET PATH=%mesa%\resource-hacker\;%PATH%
@IF %rhstate% GTR 0 FOR /F "USEBACKQ tokens=*" %%a IN (`where ResourceHacker.exe`) do @set rhloc="%%a"
@IF %rhstate% GTR 0 ResourceHacker.exe -open %rhloc% -action extract -mask VERSIONINFO,, -save %mesa%\mesa-dist-win\buildscript\assets\temp.rc -log NUL
@IF %rhstate% GTR 0 set exitloop=1&FOR /F "tokens=2 skip=2 USEBACKQ" %%a IN (`type %mesa%\mesa-dist-win\buildscript\assets\temp.rc`) do @IF defined exitloop set "exitloop="&set rhver=%%a
@IF %rhstate% GTR 0 IF %toolchain%==gcc echo Ressource Hacker %rhver:,=.%>>%mesa%\mesa-dist-win\buildinfo\mingw.txt
@IF %rhstate% GTR 0 IF %toolchain%==msvc echo Ressource Hacker %rhver:,=.%>>%mesa%\mesa-dist-win\buildinfo\msvc.txt

@rem Dump 7-Zip version and compression level
@IF EXIST %mesa%\mesa-dist-win\buildscript\assets\sevenzip.txt set /p sevenzipver=<%mesa%\mesa-dist-win\buildscript\assets\sevenzip.txt
@IF %toolchain%==gcc IF defined sevenzipver echo 7-Zip %sevenzipver% ultra compression>>%mesa%\mesa-dist-win\buildinfo\mingw.txt<commit_msg>Don't rely on Python to get Windows version<commit_after>@setlocal
@IF NOT EXIST %mesa%\mesa-dist-win\buildinfo md %mesa%\mesa-dist-win\buildinfo
@set /p enableenvdump=Do you want to dump build environment information to a text file (y/n):
@echo.
@IF /I NOT "%enableenvdump%"=="y" GOTO skipenvdump
@echo Dumping build environment information. This will take a short while...
@echo.
@IF %toolchain%==gcc echo Build environment>%mesa%\mesa-dist-win\buildinfo\mingw.txt
@IF %toolchain%==gcc echo ----------------->>%mesa%\mesa-dist-win\buildinfo\mingw.txt
@IF %toolchain%==msvc echo Build environment>%mesa%\mesa-dist-win\buildinfo\msvc.txt
@IF %toolchain%==msvc echo ----------------->>%mesa%\mesa-dist-win\buildinfo\msvc.txt

@rem Dump Windows version
@FOR /F "USEBACKQ tokens=2 delims=[" %%a IN (`ver`) DO @set winver=%%a
@set winver=%winver:~0,-1%
@FOR /F "USEBACKQ tokens=2 delims= " %%a IN (`echo %winver%`) DO @set winver=%%a
@FOR /F "USEBACKQ tokens=1-3 delims=." %%a IN (`echo %winver%`) DO @set winver=%%a.%%b.%%c
@IF %toolchain%==gcc echo Windows %winver%>>%mesa%\mesa-dist-win\buildinfo\mingw.txt
@IF %toolchain%==msvc echo Windows %winver%>>%mesa%\mesa-dist-win\buildinfo\msvc.txt

@rem Dump Resource Hacker version
@IF %rhstate%==1 SET PATH=%mesa%\resource-hacker\;%PATH%
@IF %rhstate% GTR 0 FOR /F "USEBACKQ tokens=*" %%a IN (`where ResourceHacker.exe`) do @set rhloc="%%a"
@IF %rhstate% GTR 0 ResourceHacker.exe -open %rhloc% -action extract -mask VERSIONINFO,, -save %mesa%\mesa-dist-win\buildscript\assets\temp.rc -log NUL
@IF %rhstate% GTR 0 set exitloop=1&FOR /F "tokens=2 skip=2 USEBACKQ" %%a IN (`type %mesa%\mesa-dist-win\buildscript\assets\temp.rc`) do @IF defined exitloop set "exitloop="&set rhver=%%a
@IF %rhstate% GTR 0 IF %toolchain%==gcc echo Ressource Hacker %rhver:,=.%>>%mesa%\mesa-dist-win\buildinfo\mingw.txt
@IF %rhstate% GTR 0 IF %toolchain%==msvc echo Ressource Hacker %rhver:,=.%>>%mesa%\mesa-dist-win\buildinfo\msvc.txt

@rem Dump 7-Zip version and compression level
@IF EXIST %mesa%\mesa-dist-win\buildscript\assets\sevenzip.txt set /p sevenzipver=<%mesa%\mesa-dist-win\buildscript\assets\sevenzip.txt
@IF %toolchain%==gcc IF defined sevenzipver echo 7-Zip %sevenzipver% ultra compression>>%mesa%\mesa-dist-win\buildinfo\mingw.txt
{'fraction_non_alphanumeric': 0.19256474519632413, 'fraction_numerical': 0.007101086048454469, 'mean_word_length': 5.001253132832081, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 36, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '101695', 'n_tokens_mistral': 1914, 'n_tokens_neox': 1818, 'n_words': 443}