[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: status update for grub 2 developments?
From: |
Bean |
Subject: |
Re: status update for grub 2 developments? |
Date: |
Sun, 24 Jun 2007 19:47:40 +0800 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
On Sun, Jun 24, 2007 at 12:22:18PM +0800, Bean wrote:
> Some bugs I found on scripting.
>
> 1. token parser
>
> echo aa"bb"
> aabb
> (correct)
>
> echo aa"bb"cc
> aabb
> (cc is lost)
>
> echo aa$prefix
> aa (hd0,1)/boot/grub
> (should be one token)
>
> echo $prefix/grub.cfg
> (hd0,1)/boot/grub /grub.cfg
> (should be one token)
>
> The problem here is that when a variable is mixed with text, the token breaks.
> I think this is also the reason why set doesn't work with variable.
>
> set AA=1
> set BB=$AA
>
> will expand to
>
> set AA=1
> set BB= 1
>
> Thereforce the value of BB is empty instead of 1.
>
I fix the token parser problem, changes include:
1. Inside grub_script_yylex2, mixed text is detected, and transformed into
arg structure instead of text.
2. Fix a small bug that cause trash output when an undefine variable is
referenced.
3. Close varible definition when / is encountered.
With this patch, the following command works properly:
echo aa"BB"cc
aaBBcc
set AA=1
set BB=$AA
echo $BB
1
echo $prefix/grub.cfg
(hd0,1)/boot/grub/grub.cfg
echo ${prefix}/grub.cfg
(hd0,1)/boot/grub/grub.cfg
set AA=1
echo aa"$AA"bb
aa1bb
echo aa${?}bb
aa0bb
--
Bean <address@hidden>
grub2-parser.diff
Description: Text document
- Re: status update for grub 2 developments?, (continued)
Re: status update for grub 2 developments?, Marco Gerards, 2007/06/23
Re: status update for grub 2 developments?, Marco Gerards, 2007/06/23
Re: status update for grub 2 developments?, Bean, 2007/06/23
Re: status update for grub 2 developments?, Marco Gerards, 2007/06/23
Re: status update for grub 2 developments?, Bean, 2007/06/23
Re: status update for grub 2 developments?, Marco Gerards, 2007/06/23
Re: status update for grub 2 developments?, Yoshinori K. Okuji, 2007/06/23
Re: status update for grub 2 developments?, adrian15, 2007/06/25
Re: status update for grub 2 developments?, Bean, 2007/06/25
Re: status update for grub 2 developments?, Ashok kumar, 2007/06/26