From 2bb561ea5f96f8b6edd622be16be89ee6af3cd7e Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 16 Mar 2009 03:30:01 +0000 Subject: * 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 --- win32/ifchange.bat | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'win32/ifchange.bat') diff --git a/win32/ifchange.bat b/win32/ifchange.bat index 9f6092747b..24e4987c55 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 -- cgit v1.2.3