From ff451b6ee67da29f88112b6db88a856d89731d7b Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> Date: Mon, 7 Mar 2005 12:10:03 +0000 Subject: This commit was manufactured by cvs2svn to create branch 'ruby_1_8'. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- win32/ifchange.bat | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 win32/ifchange.bat (limited to 'win32') diff --git a/win32/ifchange.bat b/win32/ifchange.bat new file mode 100755 index 000000000..61a80c841 --- /dev/null +++ b/win32/ifchange.bat @@ -0,0 +1,30 @@ +@echo off +:: usage: ifchange target temporary + +:: check if fc.exe works. +echo foo > conftest1.tmp +echo bar > conftest2.tmp +fc.exe conftest1.tmp conftest2.tmp > nul +if not errorlevel 1 goto :brokenfc + +:: target does not exist or new file differs from it. +if not exist %1 goto :update +fc.exe %1 %2 > nul +if errorlevel 1 goto :update + +:unchange +echo %1 unchanged. +del %2 +goto :end + +:brokenfc +del conftest1.tmp > nul +del conftest2.tmp > nul +echo FC.EXE does not work properly. +echo assuming %1 should be changed. + +:update +echo %1 updated. +if exist %1 del %1 +copy %2 %1 > nul +:end -- cgit