Author: dreimer
Date: Sun Aug 5 15:37:44 2007
New Revision: 28175
URL:
http://svn.reactos.org/svn/reactos?rev=28175&view=rev
Log:
Optimize scut to tell if the shortcuts exist or not.
Modified:
trunk/tools/RosBE-Windows/Root/ChangeLog.txt
trunk/tools/RosBE-Windows/Root/scut.cmd
Modified: trunk/tools/RosBE-Windows/Root/ChangeLog.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE-Windows/Root/ChangeLog…
==============================================================================
--- trunk/tools/RosBE-Windows/Root/ChangeLog.txt (original)
+++ trunk/tools/RosBE-Windows/Root/ChangeLog.txt Sun Aug 5 15:37:44 2007
@@ -5,8 +5,7 @@
*** Aug XXst, 2007 - RosBE 0.3.7.2 Released (Unsupported)
-- Updated NASM to 0.99.01 (Daniel Reimer, David Leon)
- (Small Fix by David Leon to bypass Bug in 0.99.01 which prevents our Bootsectors to
build)
+- Updated NASM to 0.99.02 (Daniel Reimer, David Leon)
- Updated Binutils 2.17.50 to Build 20070730 (Hervé Poussineau, David Leon, Daniel
Reimer)
(Small modification by Hervé Poussineau in LD to fix Bug 1244)
- Fixed the double \\ Bug introduced in 0.3.7. (Daniel Reimer)
Modified: trunk/tools/RosBE-Windows/Root/scut.cmd
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE-Windows/Root/scut.cmd?…
==============================================================================
--- trunk/tools/RosBE-Windows/Root/scut.cmd (original)
+++ trunk/tools/RosBE-Windows/Root/scut.cmd Sun Aug 5 15:37:44 2007
@@ -39,10 +39,22 @@
:: Load Shortcut from XML and set it active.
::
:RUN
-for /f "usebackq" %%i in (`"grep name=\"%XY%\"
"%ROSBEBASEDIR%\srclist.xml"|cutz dir"`) do @SET dir=%%i
-cd /D %dir%
-goto :END
+grep name=\"%XY%\" "%ROSBEBASEDIR%\srclist.xml"|cutz dir >
"%ROSBEBASEDIR%\aaa.tmp"
+test -s "%ROSBEBASEDIR%\aaa.tmp"
+if errorlevel 1 (
+ echo Shortcut with that name does not exist.
+ del "%ROSBEBASEDIR%\aaa.tmp"
+ goto :END
+) else (
+ set /P dir=<"%ROSBEBASEDIR%\aaa.tmp"
+ cd /D %dir%
+ del "%ROSBEBASEDIR%\aaa.tmp"
+ goto :END
+)
+::
+:: Add new Shortcut to XML.
+::
:ADD
if not "%2" == "" (
if not "%3" == "" (
@@ -57,9 +69,6 @@
goto :ADD1
)
-::
-:: Add new Shortcut to XML.
-::
:ADD1
echo Choose your Shortcut:
SET /P CUT=
@@ -71,6 +80,7 @@
copy "%ROSBEBASEDIR%\srclist.xml" + "%ROSBEBASEDIR%\aaa.tmp"
"%ROSBEBASEDIR%\srclist2.xml"
del "%ROSBEBASEDIR%\srclist.xml"
ren "%ROSBEBASEDIR%\srclist2.xml" srclist.xml
+del "%ROSBEBASEDIR%\aaa.tmp"
goto :END
::
@@ -84,10 +94,19 @@
echo Choose your Shortcut:
SET /P CUTREM=
:REM1
-grep -v name=\"%CUTREM%\" "%ROSBEBASEDIR%\srclist.xml" >
"%ROSBEBASEDIR%\srclist2.xml"
-del "%ROSBEBASEDIR%\srclist.xml"
-ren "%ROSBEBASEDIR%\srclist2.xml" srclist.xml
-goto :END
+grep name=\"%CUTREM%\" "%ROSBEBASEDIR%\srclist.xml"|cutz dir >
"%ROSBEBASEDIR%\aaa.tmp"
+test -s "%ROSBEBASEDIR%\aaa.tmp"
+if errorlevel 1 (
+ echo Shortcut with that name does not exist.
+ del "%ROSBEBASEDIR%\aaa.tmp"
+ goto :END
+) else (
+ grep -v name=\"%CUTREM%\" "%ROSBEBASEDIR%\srclist.xml" >
"%ROSBEBASEDIR%\srclist2.xml"
+ del "%ROSBEBASEDIR%\srclist.xml"
+ ren "%ROSBEBASEDIR%\srclist2.xml" srclist.xml
+ del "%ROSBEBASEDIR%\aaa.tmp"
+ goto :END
+)
::
:: Set Default Shortcut.
@@ -100,9 +119,21 @@
echo Choose your new Default Shortcut:
SET /P DEF=
:DEF1
-sed "s/base=\".*\"/base=\"%DEF%\"/g"
"%ROSBEBASEDIR%\srclist.xml" > "%ROSBEBASEDIR%\srclist2.xml"
-del "%ROSBEBASEDIR%\srclist.xml"
-ren "%ROSBEBASEDIR%\srclist2.xml" srclist.xml
+grep name=\"%DEF%\" "%ROSBEBASEDIR%\srclist.xml"|cutz dir >
"%ROSBEBASEDIR%\aaa.tmp"
+test -s "%ROSBEBASEDIR%\aaa.tmp"
+if errorlevel 1 (
+ echo Shortcut with that name does not exist.
+ del "%ROSBEBASEDIR%\aaa.tmp"
+ goto :END
+) else (
+ sed "s/base=\".*\"/base=\"%DEF%\"/g"
"%ROSBEBASEDIR%\srclist.xml" > "%ROSBEBASEDIR%\srclist2.xml"
+ del "%ROSBEBASEDIR%\srclist.xml"
+ ren "%ROSBEBASEDIR%\srclist2.xml" srclist.xml
+ del "%ROSBEBASEDIR%\aaa.tmp"
+ goto :PREEND
+)
+
+:PREEND
call "%ROSBEBASEDIR%\RosBE.cmd"
:END