[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [osstest test] 56922: regressions - FAIL
On Mon, 2015-05-25 at 10:25 +0800, Robert Hu wrote: > On Sun, 2015-05-24 at 14:53 +0100, Ian Campbell wrote: > > On Sat, 2015-05-23 at 16:53 +0800, Robert Hu wrote: > > > > > + $#offsets = $#offsets-1; > > > > > + $offsets[$#offsets]++; > > > may consider 'pop/push' operations on @offsets array? I worry about if > > > '$#offsets-1' can always shrink array size correctly. pop/push anyway is > > > some official way to do this. > > > > Assigning to $#offsets is defined to change the length of the array. But > > I think you are correct that pop/push would be a more idiomatic way to > > do this. > > > > It is a public holiday on Monday, but I'll take a look on Tuesday, > > unless you fancy doing it in the meantime. > Sure I will do this. Done the test with pop/push alternative. Same effect as your original patch. Here is the trivial change on your patch. diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm index 607c9ce..68101e0 100644 --- a/Osstest/Debian.pm +++ b/Osstest/Debian.pm @@ -415,7 +415,7 @@ sub setupboot_grub2 ($$$$) { "$submenu->{StartLine}. ". "Our want kern is $want_kernver"); $submenu=undef; - $#offsets = $#offsets-1; + pop @offsets; $offsets[$#offsets]++; next; } @@ -451,7 +451,7 @@ sub setupboot_grub2 ($$$$) { } if (m/^submenu\s+[\'\"](.*)[\'\"].*\{\s*$/) { $submenu={ StartLine =>$., MenuEntryPath => join ">", @offsets }; - $offsets[$#offsets+1] = 0; + push @offsets,(0); } if (m/^\s*multiboot\s*(?:\/boot)?\/(xen\S+)/) { die unless $entry; > > > > > @@ -446,11 +446,12 @@ sub setupboot_grub2 ($$$$) { > > > > > } > > > > > if (m/^menuentry\s+[\'\"](.*)[\'\"].*\{\s*$/) { > > > > > die $entry->{StartLine} if $entry; > > > > > - $entry= { Title => $1, StartLine => $., Number => > > > > > $count }; > > > > > - $count++; > > > > > + $entry= { Title => $1, StartLine => $., > > > > > MenuEntryPath => join ">", @offsets }; > > > > > + $offsets[$#offsets]++; > > > > > } > > > > > if (m/^submenu\s+[\'\"](.*)[\'\"].*\{\s*$/) { > > > > > - $submenu={ StartLine =>$.}; > > > > > + $submenu={ StartLine =>$., MenuEntryPath => join > > > > > ">", @offsets }; > > > Here MenuEntryPath element for $submenu is actually debug purpose only, > > > I think, may be can remove it. correct me if I'm wrong. > > > > It is just for debug, I think it would be OK to leave it though. > > > > Ian. > > > > _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |