Hi!
27-Мар-2004 10:09 [EMAIL PROTECTED] (Bart Oldeman) wrote to
[EMAIL PROTECTED]:
>> set b=if "%%a%%"=="" echo b
>> set c=if not "%%a%%"=="" echo c
BO> now try with
BO> set a=
BO> and for me it still echoed "c".
BO> That was the problem.
Yes, this is so for freecom. :(
BO> also try
BO> set d=echo "%%a%%"
BO> %d%
BO> Das war wohl Nix ;)
Well, experiment, then experiment:
__O\_/_\_/O__
@echo off
ver
set a=1
set b=echo "%%a%%" %%a%%
set a=0
%b%
_
O/~\ /~\O
__O\_/_\_/O__
C:\>\KERNEL\BIN\command.com /c t
FreeCom version 0.82 pl 3 XMS_Swap [Dec 10 2003 06:49:21]
"%a%" %a%
C:\>t
NDOS, Norton Utilities version 8.0, Copyright 1993 by Symantec Corporation
"0" 0
_
O/~\ /~\O
After replacing %% by % in both cases we get "1" 1, AS EXPECTED (because %a%
substitutes value of A _immediately_, not when B variable evaluated). So,
under FreeCOM double expansion also is unachived, as under MS-COMMAND.COM.
So, I suggest, best solution is to inline if condition instead %ONERROR%
manually.
PS: I don't know why tom uses this trick - probably, in his shell it works
(as for me under NDOS).
PPS:
--- Begin Message ---
diff -ruNp old/buildall.bat new/buildall.bat
--- old/buildall.bat2004-03-27 01:42:32.0 +
+++ new/buildall.bat2004-03-27 13:35:28.0 +
@@ -3,62 +3,54 @@
:- $Id$
:--
-:- batch file to build _many_ KERNELS, hope build works
+:- batch file to build _many_ KERNELS, hope build works.
:- takes 3 minutes on my(TE) Win2K/P700. your milage may vary :-)
:--
if "%1" == "$SUMMARY" goto summary
-set onerror=if not "%%XERROR%%" == "" goto daswarwohlnix
+call config.bat
+if "%LAST%" == "" goto end
:* MSCL kernels
-call config.bat
+if "%MSCL8_BASE%" == "" goto no_ms
+ call build -r msc 386 fat16
+if "%XERROR%" == "" call build -r msc 186 fat16
+if "%XERROR%" == "" call build -r msc 86 fat16
+if "%XERROR%" == "" call build -r msc 386 fat32
+if "%XERROR%" == "" call build -r msc 186 fat32
+if "%XERROR%" == "" call build -r msc 86 fat32
-if "%MS_BASE%" == "" goto no_ms
-call build -r msc 386 fat16
-%ONERROR%
-call build -r msc 186 fat16
-%ONERROR%
-call build -r msc 86 fat16
-%ONERROR%
-call build -r msc 386 fat32
-%ONERROR%
-call build -r msc 186 fat32
-%ONERROR%
-call build -r msc 86 fat32
-%ONERROR%
+if not "%XERROR%" == "" goto daswarwohlnix
:no_ms
:* TC 2.01 kernels
if "%TC2_BASE%" == "" goto no_tc
-call build -r tc 186 fat16
-%ONERROR%
-call build -r tc86 fat16
-%ONERROR%
-call build -r tc 186 fat32
-%ONERROR%
-call build -r tc86 fat32
-%ONERROR%
+ call build -r tc 186 fat16
+if "%XERROR%" == "" call build -r tc 86 fat16
+if "%XERROR%" == "" call build -r tc 186 fat32
+if "%XERROR%" == "" call build -r tc 86 fat32
+
+if not "%XERROR%" == "" goto daswarwohlnix
:no_tc
:* (Open) Watcom kernels
if "%WATCOM%" == "" goto no_wc
-call build -r wc386 fat32
-%ONERROR%
-call build -r wc386 fat16
-%ONERROR%
-call build -r wc 86 fat32
-%ONERROR%
-call build -r wc 86 fat16
-%ONERROR%
+ call build -r wc 386 fat32
+if "%XERROR%" == "" call build -r wc 386 fat16
+if "%XERROR%" == "" call build -r wc 86 fat32
+if "%XERROR%" == "" call build -r wc 86 fat16
+
+if not "%XERROR%" == "" goto daswarwohlnix
:no_wc
:* now rebuild the default kernel
call build -r
+if not "%XERROR%" == "" goto daswarwohlnix
:**
:* now we build a summary of all kernels HMA size + total size
@@ -103,6 +95,5 @@ goto end
:daswarwohlnix
echo Sorry, something didn't work as expected :-(
-set ONERROR=
:end
--- End Message ---