diff options
author | Norbert Preining <preining@logic.at> | 2008-11-17 17:27:00 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2008-11-17 17:27:00 +0000 |
commit | bac767cb1f02ac9a2cd3111546b628e1482a923e (patch) | |
tree | 3264d149ead9544000ff34812ee682e9a6733b71 | |
parent | e55aa35e09d204ef31b6aed7f2cd2dc99d28bdfa (diff) |
convert minutes in hours
git-svn-id: svn://tug.org/texlive/trunk@11331 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index a0e92931998..76d32d30106 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -815,6 +815,8 @@ sub install_packages { $tlpsizes{$p} += $tlpobjs{$p}->docsize if $opt_doc; my %foo = %{$tlpobjs{$p}->binsize}; for my $k (keys %foo) { $tlpsizes{$p} += $foo{$k}; } + # all the packages sizes are in blocks, so transfer that to bytes + $tlpsizes{$p} *= $TeXLive::TLConfig::BlockSize; } $totalsize += $tlpsizes{$p}; } @@ -831,16 +833,32 @@ sub install_packages { my $esttotalsecs = int ( ( $passedtime * $totalsize ) / $donesize ); my $remsecs = $esttotalsecs - $passedtime; my $min = int($remsecs/60); + my $hour; + if ($min >= 60) { + $hour = int($min/60); + $min %= 60; + } my $sec = $remsecs % 60; $remtime = sprintf("%02d:%02d", $min, $sec); + if ($hour) { + $remtime = sprintf("%02d:$remtime", $hour); + } my $tmin = int($esttotalsecs/60); + my $thour; + if ($tmin >= 60) { + $thour = int($tmin/60); + $tmin %= 60; + } my $tsec = $esttotalsecs % 60; $tottime = sprintf("%02d:%02d", $tmin, $tsec); + if ($thour) { + $tottime = sprintf("%02d:$tottime", $thour); + } } # here we could add more information, eg about timing and number # of bytes etc etc. # the size of the containers is present - my $infostr = sprintf("Installing [%0${td}d/$totalnr, est. time remain/total: $remtime/$tottime]: $package",$n); + my $infostr = sprintf("Installing [%0${td}d/$totalnr, est. time remain/total: $remtime/$tottime]: $package [%dkb]",$n, int($tlpsizes{$package}/1024)); info("$infostr\n"); foreach my $h (@::install_packages_hook) { &$h($n,$totalnr); |