From 7925f1b113e65204670e5ffc7b5555ceebcf679e Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 11 May 2017 02:41:34 +0000 Subject: support display of accumulated size information for schemes/collections git-svn-id: svn://tug.org/texlive/trunk@44289 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/texlive/tlmgr.pl | 88 +++++++++++++++++------------- 1 file changed, 51 insertions(+), 37 deletions(-) (limited to 'Master/texmf-dist/scripts') diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl index 1c073b7c17d..5d6e3448ac0 100755 --- a/Master/texmf-dist/scripts/texlive/tlmgr.pl +++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl @@ -1529,46 +1529,56 @@ sub action_info { print "longdesc: ", $tlp->longdesc, "\n" if ($tlp->longdesc); print "installed: ", ($installed ? "Yes" : "No"), "\n"; print "revision: ", $tlp->revision, "\n" if ($installed); - # print out sizes + # + # size computation: for normal packages give src/run/doc/bin sizes + # for scheme/collection accumulated (including deps) sizes my $sizestr = ""; - my $srcsize = $tlp->srcsize * $TeXLive::TLConfig::BlockSize; - $sizestr = sprintf("%ssrc: %dk", $sizestr, int($srcsize / 1024) + 1) - if ($srcsize > 0); - my $docsize = $tlp->docsize * $TeXLive::TLConfig::BlockSize; - $sizestr .= sprintf("%sdoc: %dk", - ($sizestr ? ", " : ""), int($docsize / 1024) + 1) - if ($docsize > 0); - my $runsize = $tlp->runsize * $TeXLive::TLConfig::BlockSize; - $sizestr .= sprintf("%srun: %dk", - ($sizestr ? ", " : ""), int($runsize / 1024) + 1) - if ($runsize > 0); - # check for .ARCH expansions - my $do_archs = 0; - for my $d ($tlp->depends) { - if ($d =~ m/^(.*)\.ARCH$/) { - $do_archs = 1; - last; + if ($tlp->category ne "Collection" && $tlp->category ne "Scheme") { + my $srcsize = $tlp->srcsize * $TeXLive::TLConfig::BlockSize; + $sizestr = sprintf("%ssrc: %dk", $sizestr, int($srcsize / 1024) + 1) + if ($srcsize > 0); + my $docsize = $tlp->docsize * $TeXLive::TLConfig::BlockSize; + $sizestr .= sprintf("%sdoc: %dk", + ($sizestr ? ", " : ""), int($docsize / 1024) + 1) + if ($docsize > 0); + my $runsize = $tlp->runsize * $TeXLive::TLConfig::BlockSize; + $sizestr .= sprintf("%srun: %dk", + ($sizestr ? ", " : ""), int($runsize / 1024) + 1) + if ($runsize > 0); + # check for .ARCH expansions + my $do_archs = 0; + for my $d ($tlp->depends) { + if ($d =~ m/^(.*)\.ARCH$/) { + $do_archs = 1; + last; + } } - } - if ($do_archs) { - my @a = $localtlpdb->available_architectures; - my %binsz = %{$tlp->binsize}; - my $binsize = 0; - for my $a (@a) { - $binsize += $binsz{$a} if defined($binsz{$a}); - my $atlp = $tlpdb->get_package($tlp->name . ".$a"); - if (!$atlp) { - tlwarn("$prg: cannot find depending package" . $tlp->name . ".$a\n"); - $ret |= $F_WARNING; - next; + if ($do_archs) { + my @a = $localtlpdb->available_architectures; + my %binsz = %{$tlp->binsize}; + my $binsize = 0; + for my $a (@a) { + $binsize += $binsz{$a} if defined($binsz{$a}); + my $atlp = $tlpdb->get_package($tlp->name . ".$a"); + if (!$atlp) { + tlwarn("$prg: cannot find depending package" . $tlp->name . ".$a\n"); + $ret |= $F_WARNING; + next; + } + my %abinsz = %{$atlp->binsize}; + $binsize += $abinsz{$a} if defined($abinsz{$a}); } - my %abinsz = %{$atlp->binsize}; - $binsize += $abinsz{$a} if defined($abinsz{$a}); + $binsize *= $TeXLive::TLConfig::BlockSize; + $sizestr .= sprintf("%sbin: %dk", + ($sizestr ? ", " : ""), int($binsize / 1024) + 1) + if ($binsize > 0); + } + } else { + # case of collection or scheme + my $foo = $tlpdb->sizes_of_packages_with_deps ( 1, 1, undef, $pkg); + if (defined($foo->{$pkg})) { + $sizestr = sprintf("%dk", int($foo->{$pkg} / 1024) + 1); } - $binsize *= $TeXLive::TLConfig::BlockSize; - $sizestr .= sprintf("%sbin: %dk", - ($sizestr ? ", " : ""), int($binsize / 1024) + 1) - if ($binsize > 0); } print "sizes: ", $sizestr, "\n"; print "relocatable: ", ($tlp->relocated ? "Yes" : "No"), "\n"; @@ -7367,10 +7377,14 @@ With the single word C or C as the argument, lists the request type instead of all packages. With any other arguments, display information about I: the name, -category, short and long description, installation status, and TeX Live +category, short and long description, sizes, installation status, and TeX Live revision number. If I is not locally installed, searches in the remote installation source. +For normal packages (not collections or schemes), the sizes of the +four groups of files (run/src/doc/bin files) are shown. For collections +and schemes the B size including depending packages. + If I is not found locally or remotely, the search action is used and lists matching packages and files. -- cgit v1.2.3