diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-16 03:30:01 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-16 03:30:01 +0000 |
| commit | d01307d91097f1a644d0cd56aa413718bf7c7974 (patch) | |
| tree | 28a8858a3698a70a24b559fc46b52bb1d212f440 /win32 | |
| parent | 5051fb10803c1a536b661d02fac82e79391bf926 (diff) | |
| download | ruby-d01307d91097f1a644d0cd56aa413718bf7c7974.tar.gz ruby-d01307d91097f1a644d0cd56aa413718bf7c7974.tar.xz ruby-d01307d91097f1a644d0cd56aa413718bf7c7974.zip | |
* common.mk (REVISION_H): keeps timestamp of revision.h.
[ruby-core:22900]
* tool/ifchange, win32/ifchange.bat: extended --timestamp option.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
| -rwxr-xr-x | win32/ifchange.bat | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/win32/ifchange.bat b/win32/ifchange.bat index 9f6092747..24e4987c5 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
|
