Re: [Freedos-kernel] Re: [Freedos-cvs] kernel buildall.bat,1.3,1.4

2004-03-27 Thread Arkady V.Belousov
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 ---


Re: [Freedos-kernel] Re: [Freedos-cvs] kernel buildall.bat,1.3,1.4

2004-03-27 Thread Bart Oldeman
On Sat, 27 Mar 2004, Arkady V.Belousov wrote:

> Batch file:
>
> __O\_/_\_/O__
> @echo off
> ver/r
> set a=1
> set b=if "%%a%%"=="" echo b
> set c=if not "%%a%%"=="" echo c
> %b%
> %c%
> _
>   O/~\ /~\O

now try with
set a=
and for me it still echoed "c".
That was the problem.

also try

set d=echo "%%a%%"
%d%

Das war wohl Nix ;)

Bart



---
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


[Freedos-kernel] Re: [Freedos-cvs] kernel buildall.bat,1.3,1.4

2004-03-27 Thread Arkady V.Belousov
Hi!

27-Мар-2004 02:36 [EMAIL PROTECTED] (Bart Oldeman) wrote to
[EMAIL PROTECTED]:

> It doesn't work with two * two % (at least in FreeCOM)
> +++ buildall.bat  27 Mar 2004 02:36:50 -  1.4
> -set onerror=if not "%%XERROR%%" == "" goto daswarwohlnix
> +set onerror=if not "%XERROR%" == "" goto daswarwohlnix

__O\_/_\_/O__
C:\TEMP\TTT\T>E:\K\BIN\command.com /c t.bat


FreeCom version 0.82 pl 3 XMS_Swap [Dec 10 2003 06:49:21]
c

C:\TEMP\TTT\T>ndos/c t.bat

NDOS, Norton Utilities version 8.0, Copyright 1993 by Symantec Corporation
c

C:\TEMP\TTT\T>command/c t

MS-DOS Version 6.22
Syntax error
Syntax error
_
  O/~\ /~\O

Batch file:

__O\_/_\_/O__
@echo off
ver/r
set a=1
set b=if "%%a%%"=="" echo b
set c=if not "%%a%%"=="" echo c
%b%
%c%
_
  O/~\ /~\O




---
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel