grub-devel
[Top][All Lists]
Advanced

[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>

Attachment: grub2-parser.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]