summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2008-12-25 09:43:07 +0000
committerNorbert Preining <preining@logic.at>2008-12-25 09:43:07 +0000
commitb26dd214751e7737d70dde4bb42ed6525f677a0c (patch)
tree9475479ac5af3b4ab6196961b09c264d63956637
parentdfbab7062be7d1d978e8a3fa0bf0870ffb1008ae (diff)
do correct size computation even if nothing is updated
git-svn-id: svn://tug.org/texlive/trunk@11716 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr2.pl16
1 files changed, 12 insertions, 4 deletions
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;