summaryrefslogtreecommitdiff
path: root/win32/ifchange.bat
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-16 03:30:01 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-16 03:30:01 (GMT)
commit2bb561ea5f96f8b6edd622be16be89ee6af3cd7e (patch)
tree28a8858a3698a70a24b559fc46b52bb1d212f440 /win32/ifchange.bat
parent40819d4599203e324cab5c6beea33cfb09a6ddfc (diff)
* common.mk (REVISION_H): keeps timestamp of revision.h.
[ruby-core:22900] * tool/ifchange, win32/ifchange.bat: extended --timestamp option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/ifchange.bat')
-rwxr-xr-xwin32/ifchange.bat22
1 files changed, 15 insertions, 7 deletions
diff --git a/win32/ifchange.bat b/win32/ifchange.bat
index 9f60927..24e4987 100755
--- a/win32/ifchange.bat
+++ b/win32/ifchange.bat
@@ -1,13 +1,20 @@
@echo off
:: usage: ifchange target temporary
-if "%1" == "" goto :end
-
set timestamp=
-if "%1" == "--timestamp" (
- set timestamp=yes
+:optloop
+for %%I in (%1) do set opt=%%~I
+if "%opt%" == "--timestamp" (
+ set timestamp=.
+ shift
+ goto :optloop
+) else if "%opt:~0,12%" == "--timestamp=" (
+ set timestamp=%opt:~12%
shift
+ goto :optloop
)
+if "%opt%" == "" goto :end
+
set dest=%1
set src=%2
set dest=%dest:/=\%
@@ -63,7 +70,8 @@ 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%"
+ if "%timestamp%" == "." (
+ for %%I in ("%dest%") do set timestamp=%%~dpI.time.%%~nxI
+ )
+ goto :end > "%timestamp%"
:end