From b26dd214751e7737d70dde4bb42ed6525f677a0c Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 25 Dec 2008 09:43:07 +0000 Subject: do correct size computation even if nothing is updated git-svn-id: svn://tug.org/texlive/trunk@11716 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf/scripts/texlive/tlmgr2.pl | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'Master/texmf') diff --git a/Master/texmf/scripts/texlive/tlmgr2.pl b/Master/texmf/scripts/texlive/tlmgr2.pl index d4746dfcf9a..1217f39a787 100755 --- a/Master/texmf/scripts/texlive/tlmgr2.pl +++ b/Master/texmf/scripts/texlive/tlmgr2.pl @@ -1521,10 +1521,18 @@ sub action_update { my $totalnr = $#new + $#updated + 2; my $nrupdated = 0; my $currnr = 1; - my %sizes = %{$mediatlpdb->sizes_of_packages( - $localtlpdb->option_install_srcfiles, - $localtlpdb->option_install_docfiles, - @new, @updated )}; + # sizes_of_packages returns the sizes of *all* packages if nothing + # is passed over, so if @new and @updated both are empty we will + # get something wrong back, namely the total size of all packages + my %sizes; + if ($totalnr > 0) { + %sizes = %{$mediatlpdb->sizes_of_packages( + $localtlpdb->option_install_srcfiles, + $localtlpdb->option_install_docfiles, + @new, @updated )}; + } else { + $sizes{'__TOTAL__'} = 0; + } print "total-bytes\t$sizes{'__TOTAL__'}\n" if $::machinereadable; print "end-of-header\n" if $::machinereadable; -- cgit v1.2.3