@echo off\r
+setlocal\r
+\r
rem usage: clean-build {scan}\r
-rem no args - remove build specific files: *_wxp_* *_wnet_* *_wlh_*\r
-rem arg1 = scan - then report matched folders & files - no delete.\r
+rem no args - remove build specific folder & files: *_wxp_* *_wnet_* *_wlh_*\r
+rem arg1 != "" - then report matched folders & files - no delete.\r
\r
-setlocal\r
set T=%TEMP%\flist.txt\r
\r
rem delete OS flavor {wlh,wxp,wnet} specific build files to ensure a clean build\r
\r
+rem The story behind the for loop need for the fake 'delims=,' is the need to\r
+rem override the default delimiters of <space> & <tab>, anything but <space>\r
+rem or <tab>. Problems occur with a folder name like\r
+rem 'c:\svn\trunk\ulp\ipoib - copy(2)\objfre_wlh_x86' as the default delimiters\r
+rem in for loop file read return 'c:\svn\trunk\ulp\ipoib', bad juju.\r
+\r
rem check/remove directories\r
\r
-for %%d in ( _wxp_ _wnet_ _wlh_ ) do (\r
+for %%d in ( _wlh_ _wnet_ _wxp_ ) do (\r
+ echo Folder Scan for *%%d*\r
dir /B /S /A:D *%%d* > %T% 2>&1\r
if ERRORLEVEL 1 (\r
del /Q/F %T%\r
) else (\r
- for /f %%f in ( %T% ) do (\r
- if "%1" == "" (\r
- rmdir /S /Q %%f 1>nul\r
- ) else (\r
- echo found %%f\r
+ for /f "delims=," %%f in ( %T% ) do (\r
+ if EXIST "%%f" (\r
+ if "%1" == "" (\r
+ rmdir /S /Q "%%f" 1>nul\r
+ ) else (\r
+ echo found "%%f"\r
+ )\r
)\r
)\r
del /Q/F %T%\r
\r
rem check/remove files\r
\r
-for %%d in ( _wxp_ _wnet_ _wlh_ ) do (\r
+for %%d in ( _wlh_ _wxp_ _wnet_ ) do (\r
+ echo File Scan for *%%d*\r
dir /B /S *%%d* > %T% 2>&1\r
if ERRORLEVEL 1 (\r
del /Q/F %T%\r
) else (\r
- for /f %%f in ( %T% ) do (\r
- if "%1" == "" (\r
- del /F /Q %%f 1>nul\r
- ) else (\r
- echo found %%f\r
+ for /f "delims=," %%f in ( %T% ) do (\r
+ if EXIST "%%f" (\r
+ if "%1" == "" (\r
+ del /F /Q "%%f" 1>nul\r
+ ) else (\r
+ echo found %%f\r
+ )\r
)\r
)\r
del /Q/F %T%\r
)\r
)\r
-\r
endlocal\r
+\r