From b669e937e611d81f5645acf97ee9f88a1d545b9e Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Tue, 26 Mar 2013 22:52:46 +0000 Subject: [PATCH] Minor Visual Studio build change --- build.vc10/out_copy_rename.bat | 37 ++++++++++++---------------------- build.vc11/out_copy_rename.bat | 37 ++++++++++++---------------------- 2 files changed, 26 insertions(+), 48 deletions(-) diff --git a/build.vc10/out_copy_rename.bat b/build.vc10/out_copy_rename.bat index 3179b59a..4fc77079 100644 --- a/build.vc10/out_copy_rename.bat +++ b/build.vc10/out_copy_rename.bat @@ -1,42 +1,31 @@ @echo off if not exist %1 goto nofile -if exist %2 goto copy +if exist %2 goto next echo creating directory %2 md %2 > nul -:copy +:next +rem strip quotes if present set str=%2 for /f "useback tokens=*" %%a in ('%str%') do set str=%%~a + +rem add a backslash if the output directory lacks one set str=%str:~-1% -if %str% == "\" goto hasbackslash +if "%str%" == "\" (set outf=%2%3) else (set outf=%2\%3) -if not exist %2\%3 goto cpy -fc %1 %2\%3 > nul && if not %errorlevel 1 goto exit -echo overwriting %2\%3 with %1 -copy %1 %2\%3 > nul -goto exit +echo copying %1 to %outf% (if not present or changed) +if not exist "%outf%" goto copy -:cpy -echo copying %1 to %2\%3 -copy %1 %2\%3 > nul -goto exit +rem don't overwrite if output exists and is not changed +fc %1 %outf% > nul && if not %errorlevel 1 goto exit +echo overwriting %outf% with %1 -:hasbackslash -if not exist %2%3 goto cpy2 -fc %1 %2%3 > nul && if not %errorlevel 1 goto exit -echo overwriting %2%3 with %1 -copy %1 %2%3 > nul -goto exit - -:cpy2 -echo copying %1 to %2%3 -copy %1 %2%3 > nul +:copy +copy %1 %outf% > nul goto exit :nofile echo %1 not found :exit - - diff --git a/build.vc11/out_copy_rename.bat b/build.vc11/out_copy_rename.bat index 3179b59a..4fc77079 100644 --- a/build.vc11/out_copy_rename.bat +++ b/build.vc11/out_copy_rename.bat @@ -1,42 +1,31 @@ @echo off if not exist %1 goto nofile -if exist %2 goto copy +if exist %2 goto next echo creating directory %2 md %2 > nul -:copy +:next +rem strip quotes if present set str=%2 for /f "useback tokens=*" %%a in ('%str%') do set str=%%~a + +rem add a backslash if the output directory lacks one set str=%str:~-1% -if %str% == "\" goto hasbackslash +if "%str%" == "\" (set outf=%2%3) else (set outf=%2\%3) -if not exist %2\%3 goto cpy -fc %1 %2\%3 > nul && if not %errorlevel 1 goto exit -echo overwriting %2\%3 with %1 -copy %1 %2\%3 > nul -goto exit +echo copying %1 to %outf% (if not present or changed) +if not exist "%outf%" goto copy -:cpy -echo copying %1 to %2\%3 -copy %1 %2\%3 > nul -goto exit +rem don't overwrite if output exists and is not changed +fc %1 %outf% > nul && if not %errorlevel 1 goto exit +echo overwriting %outf% with %1 -:hasbackslash -if not exist %2%3 goto cpy2 -fc %1 %2%3 > nul && if not %errorlevel 1 goto exit -echo overwriting %2%3 with %1 -copy %1 %2%3 > nul -goto exit - -:cpy2 -echo copying %1 to %2%3 -copy %1 %2%3 > nul +:copy +copy %1 %outf% > nul goto exit :nofile echo %1 not found :exit - -