ForgePatch/forge/update_patches.bat
LexManos b8a84f2c29 Changed the windows setup to use del instead of remove.
Both update patches scripts no longer remove svn entries.
Added the forge_client\bin and forge_server\bin folders to the svn ignore.
2011-10-10 23:47:30 +00:00

35 lines
968 B
Batchfile

@setlocal enabledelayedexpansion
@echo off
set PATH=.\bin;%PATH%
echo Creating directories
for /f %%i in ('find ../src_work -type d') do (
set file=%%i
set file=!file:~11!
rem echo patches!file!
"./bin/mkdir.exe" --parents "patches!file!"
)
echo Creating patches
for /f %%i in ('find ../src_work -type f') do (
set file=%%i
set file=!file:~11!
rem echo !file!
diff -u ../src_base!file! ../src_work!file! -r --strip-trailing-cr --new-file | sed -e "1,2s/[0-9-]* [0-9:\.]* [+-][0-9]*\b/0000-00-00 00:00:00.000000000 -0000/" | tr -d '\r' > patches!file!.patch
)
echo Removing empty patches
for /f %%i in ('find patches -size 0 -type f') do (
set file=%%i
rem Have to do this to filter out .svn entries
if /I "!file:~-6!" EQU ".patch" (
del !file:/=\!
)
)
for /f %%i in ('find patches -depth -empty -type d') do (
set file=%%i
if "!file:.svn=!" EQU "!file!" (
rmdir "%%i"
)
)
echo Finished
pause