Bug #1919
Package re-install loop on console after upgrade - package reinstall take ages on serial console
| Status: | New | Start date: | 09/29/2011 | |
|---|---|---|---|---|
| Priority: | High | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | Upgrade | |||
| Target version: | - | |||
| 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();
}
History
#1
Updated by Chris Buechler over 1 year ago
- Target version deleted (
2.0.1)