summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2017-05-11 02:41:34 +0000
committerNorbert Preining <preining@logic.at>2017-05-11 02:41:34 +0000
commit7925f1b113e65204670e5ffc7b5555ceebcf679e (patch)
tree3652e642ffde29033c2af4c9bd811da59c1798be /Master/texmf-dist/scripts
parent7715cab10d0dc23918aeb484da4a432f3e27fd14 (diff)
support display of accumulated size information for schemes/collections
git-svn-id: svn://tug.org/texlive/trunk@44289 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts')
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/tlmgr.pl88
1 files changed, 51 insertions, 37 deletions
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<collections> or C<schemes> as the argument, lists
the request type instead of all packages.
With any other arguments, display information about I<pkg>: 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<pkg> 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<accumulated> size including depending packages.
+
If I<pkg> is not found locally or remotely, the search action is used
and lists matching packages and files.