summaryrefslogtreecommitdiff
path: root/win32/ifchange.bat
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-17 10:46:23 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-17 10:46:23 (GMT)
commitb025ce46786ced077d67c2a2bbe53af3f819f9d7 (patch)
tree242aef5fa2be80f10e11f4f52598f299fc66a118 /win32/ifchange.bat
parent6e738bf2b19fdb8c15a00e08b417596e00452ea0 (diff)
* common.mk (ID_H_TARGET): phony target to update id.h.
* tool/ifchange, win32/ifchange.bat: --timestamp option added. * tool/generic_erb.rb: --timestamp, --output and --if-change options added. * template/id.h.tmpl: moved from id.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/ifchange.bat')
-rwxr-xr-xwin32/ifchange.bat16
1 files changed, 13 insertions, 3 deletions
diff --git a/win32/ifchange.bat b/win32/ifchange.bat
index 8411099..9f60927 100755
--- a/win32/ifchange.bat
+++ b/win32/ifchange.bat
@@ -3,6 +3,11 @@
if "%1" == "" goto :end
+set timestamp=
+if "%1" == "--timestamp" (
+ set timestamp=yes
+ shift
+)
set dest=%1
set src=%2
set dest=%dest:/=\%
@@ -47,13 +52,18 @@ goto :end
if not exist %src% goto :end
if exist %dest% (
fc.exe %dest% %src% > nul && (
- echo %dest% unchanged.
+ echo %1 unchanged.
del %src%
- goto :end
+ goto :nt_end
)
)
-echo %dest% updated.
+echo %1 updated.
copy %src% %dest% > nul
del %src%
+:nt_end
+if "%timestamp%" == "" goto :end
+ for %%I in ("%dest%") do set timestamp=%%~dpI\.time.%%~nxI
+ if not exist "%timestamp%" copy nul "%timestamp%" > nul
+ goto :end >> "%timestamp%"
:end