From 46830474bdbdd32a62183e4c21e7eaeffd834168 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 16 Sep 2022 22:10:53 +0900 Subject: [PATCH 1/4] ifchange: Allow options with an argument without quoting A batch file splits the command line with equal signs (`=`) not only spaces. --- win32/ifchange.bat | 102 ++++++++++++++++++++++++++++----------------- 1 file changed, 63 insertions(+), 39 deletions(-) diff --git a/win32/ifchange.bat b/win32/ifchange.bat index 1de98f99900d70..cc0ef85cf3af32 100755 --- a/win32/ifchange.bat +++ b/win32/ifchange.bat @@ -1,54 +1,78 @@ @echo off :: usage: ifchange target temporary +:: @set PROMPT=$T:$S for %%I in (%0) do set progname=%%~nI set timestamp= set keepsuffix= set empty= set color=auto :optloop +set optarg= +:optnext for %%I in (%1) do set opt=%%~I -if "%opt%" == "--" ( - shift -) else if "%opt%" == "--timestamp" ( - set timestamp=. - shift - goto :optloop -) else if "%opt:~0,12%" == "--timestamp=" ( - set timestamp=%opt:~12% - shift - goto :optloop -) else if "%opt%" == "--keep" ( - set keepsuffix=.old - shift - goto :optloop -) else if "%opt:~0,7%" == "--keep=" ( - set keepsuffix=%opt:~7% - shift - goto :optloop -) else if "%opt%" == "--empty" ( - set empty=yes - shift - goto :optloop -) else if "%opt%" == "--color" ( - set color=always - shift - goto :optloop -) else if "%opt:~0,8%" == "--color=" ( - set color=%opt:~8% - shift - goto :optloop -) else if "%opt%" == "--debug" ( - shift - echo on - goto :optloop -) else if "%opt%" == "--help" ( - call :help - exit /b -) else if "%opt:~0,2%" == "--" ( + if not "%opt:~0,2%" == "--" ( + if not "%optarg%" == "" ( + call set %optarg%=%%opt%% + shift + goto :optloop + ) + goto :optend + ) + if "%opt%" == "--" ( + shift + goto :optend + ) + if "%opt%" == "--timestamp" ( + set timestamp=. + set optarg=timestamp + shift + goto :optnext + ) + if "%opt:~0,12%" == "--timestamp=" ( + set timestamp=%opt:~12% + shift + goto :optloop + ) + if "%opt%" == "--keep" ( + set keepsuffix=.old + set optarg=keep + shift + goto :optnext + ) + if "%opt:~0,7%" == "--keep=" ( + set keepsuffix=%opt:~7% + shift + goto :optloop + ) + if "%opt%" == "--empty" ( + set empty=yes + shift + goto :optloop + ) + if "%opt%" == "--color" ( + set color=always + set optarg=color + shift + goto :optnext + ) + if "%opt:~0,8%" == "--color=" ( + set color=%opt:~8% + shift + goto :optloop + ) + if "%opt%" == "--debug" ( + shift + echo on + goto :optloop + ) + if "%opt%" == "--help" ( + call :help + exit /b + ) echo %progname%: unknown option: %1 1>&2 exit /b 1 -) +:optend if "%2" == "" ( call :help 1>&2 From ed69b9ed12f374d2dd7b9185d83075c56d916173 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 29 Sep 2025 15:06:36 +0900 Subject: [PATCH 2/4] ifchange: Allow input from stdin --- win32/ifchange.bat | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/win32/ifchange.bat b/win32/ifchange.bat index cc0ef85cf3af32..c7a57fad3583c4 100755 --- a/win32/ifchange.bat +++ b/win32/ifchange.bat @@ -84,6 +84,19 @@ set src=%2 set dest=%dest:/=\% set src=%src:/=\% +if not "%src%" == "-" goto :srcfile + if not "%TMPDIR%" == "" ( + set src=%TMPDIR%\ifchange%RANDOM%.tmp + ) else if not "%TEMP%" == "" ( + set src=%TEMP%\ifchange%RANDOM%.tmp + ) else if not "%TMP%" == "" ( + set src=%TMP%\ifchange%RANDOM%.tmp + ) else ( + set src=.\ifchange%RANDOM%.tmp + ) + findstr -r -c:"^" > "%src%" +:srcfile + if exist %dest% ( if not exist %src% goto :nt_unchanged1 if not "%empty%" == "" for %%I in (%src%) do if %%~zI == 0 goto :nt_unchanged From a35973366ac0a02c388440f3d2b76b3146a9fb8f Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 29 Sep 2025 15:19:32 +0900 Subject: [PATCH 3/4] lastrev.bat: Extract from windows.yml workflow --- .github/workflows/windows.yml | 25 ++----------------------- win32/lastrev.bat | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 23 deletions(-) create mode 100755 win32/lastrev.bat diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index af3d48de72d2d2..38f628243ccff4 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -154,30 +154,9 @@ jobs: # windows-11-arm runner cannot run `ruby tool/file2lastrev.rb --revision.h --output=revision.h` - name: make revision.h run: | - if not exist revision.h ( - for /f "tokens=1-3" %%I in ('git log -1 "--date=format-local:%%F %%T" "--format=%%H %%cd" @') do ( - set rev=%%I - set dt=%%J - set tm=%%K - ) - call set yy=%%dt:~0,4%% - call set /a mm=100%%dt:~5,2%% %%%% 100 - call set /a dd=100%%dt:~8,2%% %%%% 100 - call set branch=%%GITHUB_REF:refs/heads/=%% - ( - call echo #define RUBY_REVISION "%%rev:~,10%%" - call echo #define RUBY_FULL_REVISION "%%rev%%" - call echo #define RUBY_BRANCH_NAME "%%branch%%" - call echo #define RUBY_RELEASE_DATETIME "%%dt%%T%%tm%%" - call echo #define RUBY_RELEASE_YEAR %%yy%% - call echo #define RUBY_RELEASE_MONTH %%mm%% - call echo #define RUBY_RELEASE_DAY %%dd%% - ) > revision.h - copy /y NUL .revision.time - ) + win32\lastrev.bat | win32\ifchange.bat --timestamp=.revision.time revision.h - type revision.h - env: - TZ: UTC + working-directory: src - run: nmake diff --git a/win32/lastrev.bat b/win32/lastrev.bat new file mode 100755 index 00000000000000..f1c799f8976f2c --- /dev/null +++ b/win32/lastrev.bat @@ -0,0 +1,29 @@ +@setlocal +@echo off +if "%1" == "" (set gitdir=.) else (set gitdir=%1) +set TZ=UTC +for /f "usebackq tokens=1-3" %%I in ( + `git -C "%gitdir%" log -1 --no-show-signature "--date=format-local:%%F %%T" "--format=%%H %%cd" HEAD` +) do ( + set rev=%%I + set dt=%%J + set tm=%%K +) +if not "%dt%" == "" ( + set /a yy=%dt:-=% / 10000 + set /a mm=%dt:-=% / 100 %% 100 + set /a dd=%dt:-=% %% 100 +) +for /f "usebackq tokens=1" %%I in ( + `git -C "%gitdir%" symbolic-ref --short HEAD` +) do set branch=%%I +if not "%rev%" == "" ( + echo #define RUBY_REVISION "%rev:~,10%" + echo #define RUBY_FULL_REVISION "%rev%" + echo #define RUBY_BRANCH_NAME "%branch%" + echo #define RUBY_RELEASE_DATETIME "%dt%T%tm%Z" + echo #define RUBY_RELEASE_YEAR %yy% + echo #define RUBY_RELEASE_MONTH %mm% + echo #define RUBY_RELEASE_DAY %dd% +) +@endlocal From f4480095ebd4b241b881d6639e83ef86832e3712 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Sep 2025 02:20:00 +0000 Subject: [PATCH 4/4] Bump github.com/microsoft/vcpkg from master to 2025.09.17 Bumps [github.com/microsoft/vcpkg](https://github.com/microsoft/vcpkg) from master to 2025.09.17. This release includes the previously tagged commit. - [Release notes](https://github.com/microsoft/vcpkg/releases) - [Commits](https://github.com/microsoft/vcpkg/compare/120deac3062162151622ca4860575a33844ba10b...4334d8b4c8916018600212ab4dd4bbdc343065d1) --- updated-dependencies: - dependency-name: github.com/microsoft/vcpkg dependency-version: 2025.09.17 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcpkg.json b/vcpkg.json index 7ea28de5a2da23..b8b0faf93edb1a 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -7,5 +7,5 @@ "openssl", "zlib" ], - "builtin-baseline": "120deac3062162151622ca4860575a33844ba10b" + "builtin-baseline": "4334d8b4c8916018600212ab4dd4bbdc343065d1" } \ No newline at end of file