WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH 4 of 6] parse configurations with submenus

To: M A Young <m.a.young@xxxxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH 4 of 6] parse configurations with submenus
From: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Thu, 20 Oct 2011 09:27:27 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 20 Oct 2011 01:27:58 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <alpine.DEB.2.00.1110200008540.15667@xxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Citrix Systems, Inc.
References: <alpine.DEB.2.00.1110200008540.15667@xxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Thu, 2011-10-20 at 00:09 +0100, M A Young wrote:
> The grub2 configuration file in Fedora 16 can have one or menuentrys
                                                           ^more ?
> in a submenu, with configuration of the form
> submenu "Xen 4.1" {
> menuentry ... {
> ...
> }
> }
> (this example occurs when the xen hypervisor is installed on the
> guest)
> Ignore the submenu line and the corresponding } 
> Signed-off-by: Michael Young <m.a.young@xxxxxxxxxxxx>

Acked-by: Ian Cambell <ian.campbell@xxxxxxxxxx>

> 
> --- a/tools/pygrub/src/GrubConf.py      2011-10-17 21:26:48.000000000
> +0100
> +++ b/tools/pygrub/src/GrubConf.py      2011-10-17 21:46:00.000000000
> +0100
> @@ -368,6 +368,7 @@
>          in_function = False
>          img = None
>          title = ""
> +        menu_level=0
>          for l in lines:
>              l = l.strip()
>              # skip blank lines
> @@ -394,10 +395,18 @@
>                  img = []
>                  title = title_match.group(1)
>                  continue
> -            
> +
> +            if l.startswith("submenu"):
> +                menu_level += 1
> +                continue
> +
>              if l.startswith("}"):
>                  if img is None:
> -                    raise RuntimeError, "syntax error: closing brace
> without menuentry"
> +                    if menu_level > 0:
> +                        menu_level -= 1
> +                        continue
> +                    else:
> +                        raise RuntimeError, "syntax error: closing
> brace without menuentry"
>  
>                  self.add_image(Grub2Image(title, img))
>                  img = None
> 
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>