diff -Nur -x '*.orig' -x '*.rej' smeserver-yum-1.2.0/root/etc/e-smith/web/functions/yum mezzanine_patched_smeserver-yum-1.2.0/root/etc/e-smith/web/functions/yum --- smeserver-yum-1.2.0/root/etc/e-smith/web/functions/yum 2006-11-21 13:34:25.756517569 +1100 +++ mezzanine_patched_smeserver-yum-1.2.0/root/etc/e-smith/web/functions/yum 2006-11-21 13:18:11.621185791 +1100 @@ -36,7 +36,7 @@ if (-e "/var/run/yum.pid") { - print_yum_status_page(); + $f->print_yum_status_page(); exit(0); } diff -Nur -x '*.orig' -x '*.rej' smeserver-yum-1.2.0/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/yum.pm mezzanine_patched_smeserver-yum-1.2.0/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/yum.pm --- smeserver-yum-1.2.0/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/yum.pm 2006-11-21 13:34:25.757517394 +1100 +++ mezzanine_patched_smeserver-yum-1.2.0/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/yum.pm 2006-11-21 13:30:42.103471925 +1100 @@ -222,7 +222,7 @@ $db->reload; - print_yum_status_page(); + $fm->print_yum_status_page(); } sub print_skip_header @@ -230,24 +230,33 @@ return "\n"; } +sub format_yum_log +{ + my ($fm) = @_; + + my $yum_log = $db->get_prop('yum', 'LogFile'); + + return '' unless $yum_log and -f $yum_log; + + my @contents; + + open my $log_file, "<", $yum_log or die "Couldn't open $yum_log\n"; + push @contents, "
", <$log_file>, "
"; + close $log_file or die "Failed to close $yum_log\n"; + + return @contents; +} + sub print_yum_status_page { + my ($fm) = @_; my @yum_status; open(YUM_STATUS, "; close(YUM_STATUS); - my $yum_log = $db->get_prop('yum', 'LogFile'); - my @yum_log; - - if ($yum_log) - { - open(YUM_LOG, "<", "$yum_log"); - - @yum_log = ; - close YUM_LOG - } + my @yum_log = $fm->format_yum_log(); my $page_output = << "EOF"; Expires: 0 @@ -265,9 +274,7 @@

Please Wait - Yum Running (@yum_status)

-
   @yum_log
-  
EOF @@ -339,16 +346,9 @@ { my $fm = shift; - my $yum_log = $db->get_prop('yum', 'LogFile'); - - return unless $yum_log and -f $yum_log; - - open my $log_file, "<", $yum_log or die "Couldn't open $yum_log\n"; - print "
";
-    print <$log_file>;
-    print "
"; - close $log_file or die "Failed to close $yum_log\n"; + print $fm->format_yum_log(); + my $yum_log = $db->get_prop_and_delete('yum', 'LogFile'); return; } @@ -356,7 +356,6 @@ { my $fm = shift; - $db->get_prop_and_delete("yum", "LogFile"); $fm->success('HEADER_POSTUPGRADE_REQUIRED', 'YUM_PAGE_POSTUPGRADE'); $fm->{cgi}->param(-name => "page", -value => 0);