edit all the menuentry and submenu entries.
This is a good idea because in princple the first menu and submenu
entries in the autogenerated grub.cfg might be in a function which is
not actually called.
The resulting grub menu now looks even sillier.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
} else {
# no support for grub1
$edit->('/boot/grub/grub.cfg', sub {
- my %done;
while (<::EI>) {
- s{^(\s* ( menuentry | submenu ) \s+
- (['"]) )( [^'"]+ \3) }{
- $done{$2}++ ? $& : "$1$c $4"
- }xe;
+ s{^(\s* (?: menuentry | submenu ) \s+
+ (['"]) )( [^'"]+ \2) }{$1$c $3}x;
print ::EO;
}
});