From bac767cb1f02ac9a2cd3111546b628e1482a923e Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 17 Nov 2008 17:27:00 +0000 Subject: convert minutes in hours git-svn-id: svn://tug.org/texlive/trunk@11331 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLUtils.pm | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'Master') 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); -- cgit v1.2.3