Project

General

Profile

Actions

Bug #1919

closed

Package re-install loop on console after upgrade - package reinstall take ages on serial console

Added by Louis-David Perron over 12 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
High
Assignee:
-
Category:
Upgrade
Target version:
-
Start date:
09/29/2011
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
2.0
Affected Architecture:
All

Description

In fact, this is not an actual loop.... it's rather an innefiency in update_output_window() when $pkg_interface == "console".

The text is being output to the console, but the variable $static_output is still accumulating text, so update_output_window only prints repeated text, with some additions on every calls. That simply square the amount of character being sent to the console. On a 9600 link... reinstalling squid/squidguard packages takes more than an hour!

My fix is simple, but very ackward on the programming style. I added $static_output as a global variable, and then I clear its content after the "echo":

function update_output_window($text) {
        global $pkg_interface, $static_output;
        $log = ereg_replace("\n", "\\n", $text);
        if($pkg_interface != "console") {
                echo "\n<script language=\"JavaScript\">\nthis.document.forms[0].output.value = \"" . $log . "\";\n";
                                echo "this.document.forms[0].output.scrollTop = this.document.forms[0].output.scrollHeight;\n";
                                echo "</script>";
        } else
        {
                echo $text;
                $static_output="";
        }
        /* ensure that contents are written out */
        ob_flush();
}
Actions #1

Updated by Chris Buechler over 12 years ago

  • Target version deleted (2.0.1)
Actions #2

Updated by Louis-David Perron over 10 years ago

This bug may be closed since it's not present at all in 2.1.

Thanks

Actions #3

Updated by Jim Pingle over 10 years ago

  • Status changed from New to Resolved
Actions

Also available in: Atom PDF