summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2017-09-01 08:01:01 +0000
committerNorbert Preining <preining@logic.at>2017-09-01 08:01:01 +0000
commit2748c073a860377e8ab486a254b71f8a8f416a23 (patch)
tree500e36b06cc2c10058c696f46ecc5e75ad922f72 /Master/texmf-dist/scripts
parent45505da7208c4dee5f73974e6f3143c658edfdd0 (diff)
allow size field in tlmgr info --data
git-svn-id: svn://tug.org/texlive/trunk@45190 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts')
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/tlmgr.pl15
1 files changed, 13 insertions, 2 deletions
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl
index 9601fe4cea8..468ce13a793 100755
--- a/Master/texmf-dist/scripts/texlive/tlmgr.pl
+++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl
@@ -1408,7 +1408,7 @@ sub action_info {
@datafields = split(',', $opts{'data'});
# check for correctness of data fields
for my $d (@datafields) {
- if ($d !~ m/name|category|localrev|remoterev|shortdesc|longdesc|installed|relocatable|cat-version|cat-date|cat-license/) {
+ if ($d !~ m/name|category|localrev|remoterev|shortdesc|longdesc|size|installed|relocatable|cat-version|cat-date|cat-license/) {
tlwarn("unknown data field: $d\n");
return($F_ERROR);
}
@@ -3609,6 +3609,17 @@ sub show_one_package_csv {
push @out, ($is_installed ? $loctlp->revision : 0);
} elsif ($d eq "remoterev") {
push @out, ($is_available ? $remtlp->revision : 0);
+ } elsif ($d eq "size") {
+ # tlp->*size is in 4k blocks!
+ my $srcsize = $tlp->srcsize * $TeXLive::TLConfig::BlockSize;
+ my $docsize = $tlp->docsize * $TeXLive::TLConfig::BlockSize;
+ my $runsize = $tlp->runsize * $TeXLive::TLConfig::BlockSize;
+ my $binsize = 0;
+ my $binsizes = $tlp->binsize;
+ for my $a (keys %$binsizes) { $binsize += $binsizes->{$a} ; }
+ $binsize *= $TeXLive::TLConfig::BlockSize;
+ my $totalsize = $srcsize + $docsize + $runsize + $binsize;
+ push @out, $totalsize;
} else {
tlwarn("$prg: unkown data field $d\n");
return($F_WARNING);
@@ -7599,7 +7610,7 @@ locally installed packages, collections, or schemes are listed.
If the option C<--data> is given, its argument must be a comma separated
list of field names from: C<name>, C<category>, C<localrev>, C<remoterev>,
-C<shortdesc>, C<longdesc>, C<installed>, C<relocatable>, C<cat-version>,
+C<shortdesc>, C<longdesc>, C<installed>, C<size>, C<relocatable>, C<cat-version>,
C<cat-date>, or C<cat-licence>. In this case the requested packages'
information is listed in CSV format one package per line, and the
column information is given by the C<itemN>.