[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 2/9] Debian grub2: Optimize and re-format submenu parsing



From: Robert Ho <robert.hu@xxxxxxxxx>

* space between ')' and '{'; and after '='
* omit unnecessary 'define' and '!defined' usage
* break long '{}' into several lines

Signed-off-by: Robert Ho <robert.hu@xxxxxxxxx>
Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
v14: Drop removal of MenuEntryPath setting in grub2 submenu parse
---
 Osstest/Debian.pm |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index a8b62ca..2b8d9f3 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -421,10 +421,10 @@ sub setupboot_grub2 ($$$$) {
             next if m/^\s*\#/ || !m/\S/;
             if (m/^\s*\}\s*$/) {
                 die unless $entry || $submenu;
-                if (!defined $entry && defined $submenu) {
+                if (!$entry && $submenu) {
                     logm("Met end of a submenu $submenu->{StartLine}..$.. ".
                         "Our want kern is $want_kernver");
-                    $submenu=undef;
+                    $submenu= undef;
                     pop @offsets;
                     $offsets[$#offsets]++;
                     next;
@@ -465,7 +465,9 @@ sub setupboot_grub2 ($$$$) {
             }
             if (m/^\s*menuentry\s+[\'\"](.*)[\'\"].*\{\s*$/) {
                 die $entry->{StartLine} if $entry;
-                $entry= { Title => $1, StartLine => $., MenuEntryPath => join 
">", @offsets };
+                $entry= { Title => $1,
+                         StartLine => $.,
+                         MenuEntryPath => join ">", @offsets };
                 $offsets[$#offsets]++;
             }
             if (m/^\s*submenu\s+[\'\"](.*)[\'\"].*\{\s*$/) {
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.