summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;