diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2011-01-06 18:02:47 -0500 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2011-01-06 18:02:47 -0500 |
commit | a0e157e99484b74130a0a0b729208ca4b43b5229 (patch) | |
tree | 2517f9f7f70d816ef633781329c46247f7318342 | |
parent | 86af45ecbed9fc0dddfd840c6384e015fe8a597f (diff) | |
download | pfsense-a0e157e99484b74130a0a0b729208ca4b43b5229.zip pfsense-a0e157e99484b74130a0a0b729208ca4b43b5229.tar.gz |
When installing packages on console (downloading) only show every 10% meaning 10% 20% 30% instead of 1% 2% 3% 4% 5%, etc
-rw-r--r-- | etc/inc/pfsense-utils.inc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index cd640b7..feb32f0 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -1458,6 +1458,7 @@ function read_header($ch, $string) { function read_body($ch, $string) { global $fout, $file_size, $downloaded, $sendto, $static_status, $static_output, $lastseen; + global $pkg_interface; $length = strlen($string); $downloaded += intval($length); if($file_size > 0) { @@ -1467,11 +1468,25 @@ function read_body($ch, $string) { $downloadProgress = 0; if($lastseen <> $downloadProgress and $downloadProgress < 101) { if($sendto == "status") { + if($pkg_interface == "console") { + if(substr($downloadProgress,2,1) == "0") { + $tostatus = $static_status . $downloadProgress . "%"; + update_status($tostatus); + } + } else { $tostatus = $static_status . $downloadProgress . "%"; - update_status($tostatus); + update_status($tostatus); + } } else { + if($pkg_interface == "console") { + if(substr($downloadProgress,2,1) == "0") { + $tooutput = $static_output . $downloadProgress . "%"; + update_output_window($tooutput); + } + } else { $tooutput = $static_output . $downloadProgress . "%"; update_output_window($tooutput); + } } update_progress_bar($downloadProgress); $lastseen = $downloadProgress; |