From 039648bbf4d35e12379f03f862399f90bb0a45f7 Mon Sep 17 00:00:00 2001 From: freesource Date: Sat, 2 Sep 2000 02:31:59 +0000 Subject: [PATCH] Submit logic looks perfect now, and wanted to add that gdkbirdaa was added in 1.19. --- gBootRoot | 64 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 22 deletions(-) diff --git a/gBootRoot b/gBootRoot index f9b62c7..fc05968 100644 --- a/gBootRoot +++ b/gBootRoot @@ -523,6 +523,7 @@ sub advanced_section { label_advanced("append =",0,1,3,4); $ea3 = entry_advanced(1,2,3,4,2); my $append; (undef,undef,$append) = gdkbirdaao(); + $tooltips->set_tip( $ea3, "Add append options to brlilo.conf.", ""); $ea3->set_text($append) if defined $append; # Verbosity section @@ -810,6 +811,7 @@ sub button { sub submit { my($kernel,$root_image); + # comment this out for testing unlink("$verbosefn"); open (MTAB, "/etc/mtab") or die "no mtab!\n"; @@ -906,24 +908,39 @@ elsif (defined $container[0] && defined $container[1] && $container[9] = $entry_advanced[0] . "ea1"; } - # not quite there .. .* to "" not working yet - if ($entry_advanced[1]) { - push(@original_container,$entry_advanced[1]) if !$container[10]; - if ($container[10]) { - $container[10] = $entry_advanced[1]; + # Works now .. whoosh! + if ($container[10]) { + if ($container[10] ne "") { + $container[10] = $entry_advanced[1] if $entry_advanced[1]; + } + if (defined $entry_advanced[1] and $entry_advanced[1] eq "") { + $container[10] = ""; + } + elsif ($container[10] eq "") { + push(@original_container,$entry_advanced[1]); } - } - - # pretty complex and works properly - if ($container[11] ne "") { - $container[11] = $entry_advanced[2] if $entry_advanced[2]; } - if (defined $entry_advanced[2] and $entry_advanced[2] eq "") { - $container[11] = ""; + else { + push(@original_container,$entry_advanced[1]) + if $entry_advanced[1]; } - elsif ($container[11] eq "") { - push(@original_container,$entry_advanced[2]); + + # pretty complex and works properly even for !-e lilo.conf + if ($container[11]) { + if ($container[11] ne "") { + $container[11] = $entry_advanced[2] if $entry_advanced[2]; + } + if (defined $entry_advanced[2] and $entry_advanced[2] eq "") { + $container[11] = ""; + } + elsif ($container[11] eq "") { + push(@original_container,$entry_advanced[2]); + } } + else { + push(@original_container,$entry_advanced[2]) + if $entry_advanced[2]; + } if (@original_container) { # defined array deprecate Perl 5.6 - zas@metaconcept.com # a hash check isn't perfect for two values which are the same @@ -931,12 +948,18 @@ elsif (defined $container[0] && defined $container[1] && my @temp_container = @container; - # Got it! - if ($container[10] and $container[10] eq "") { + # Got it! - how to deal with fields with no init value + if (defined $container[10] and $container[10] eq "") { + $container[10] = $entry_advanced[1]; + } + if (!defined $container[10]) { $container[10] = $entry_advanced[1]; } - if ($container[11] eq "") { - $container[11] = $entry_advanced[2] + if (defined $container[11] and $container[11] eq "") { + $container[11] = $entry_advanced[2]; + } + if (!defined $container[11]) { + $container[11] = $entry_advanced[2]; } # no sense looking at undef values @@ -958,7 +981,7 @@ elsif (defined $container[0] && defined $container[1] && splice(@temp_container,1,1); # A test which I've had to run too often - # print "BEFORE @temp_container\nAFTER @original_container\n"; + #print "BEFORE @temp_container\nAFTER @original_container\n"; my %diff; grep($diff{$_}++,@temp_container); @@ -979,9 +1002,6 @@ elsif (defined $container[0] && defined $container[1] && } # reset - - # entry fun - @original_container = ($container[0],$root_image,$device,$size, $compress,$container[6],$container[7], $container[8],$container[9],$container[10],