texlive[45190] Master/texmf-dist/scripts/texlive/tlmgr.pl: allow size

commits+preining at tug.org commits+preining at tug.org
Fri Sep 1 10:01:01 CEST 2017


Revision: 45190
          http://tug.org/svn/texlive?view=revision&revision=45190
Author:   preining
Date:     2017-09-01 10:01:01 +0200 (Fri, 01 Sep 2017)
Log Message:
-----------
allow size field in tlmgr info --data

Modified Paths:
--------------
    trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl

Modified: trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl	2017-09-01 01:34:26 UTC (rev 45189)
+++ trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl	2017-09-01 08:01:01 UTC (rev 45190)
@@ -1408,7 +1408,7 @@
     @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 @@
       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 @@
 
 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>.



More information about the tex-live-commits mailing list