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

[Xen-changelog] [xen-unstable] pygrub: cope with configurations with sub

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] pygrub: cope with configurations with submenus
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Wed, 26 Oct 2011 20:55:13 +0100
Delivery-date: Wed, 26 Oct 2011 12:56:21 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Michael Young <m.a.young@xxxxxxxxxxxx>
# Date 1319566806 -3600
# Node ID 152049468175f29a3792b3b60e09a841f9cd2c21
# Parent  65679fee01778aec2dbe9988959da6b57c52d6c9
pygrub: cope with configurations with submenus

The grub2 configuration file in Fedora 16 can have one or more
menuentrys 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 Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r 65679fee0177 -r 152049468175 tools/pygrub/src/GrubConf.py
--- a/tools/pygrub/src/GrubConf.py      Tue Oct 25 19:19:19 2011 +0100
+++ b/tools/pygrub/src/GrubConf.py      Tue Oct 25 19:20:06 2011 +0100
@@ -370,6 +370,7 @@
         in_function = False
         img = None
         title = ""
+        menu_level=0
         for l in lines:
             l = l.strip()
             # skip blank lines
@@ -396,10 +397,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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] pygrub: cope with configurations with submenus, Xen patchbot-unstable <=