texlive[44290] Master/tlpkg/TeXLive/TLPDB.pm: fixes for scheme size

commits+preining at tug.org commits+preining at tug.org
Thu May 11 05:13:32 CEST 2017


Revision: 44290
          http://tug.org/svn/texlive?view=revision&revision=44290
Author:   preining
Date:     2017-05-11 05:13:32 +0200 (Thu, 11 May 2017)
Log Message:
-----------
fixes for scheme size computation

Modified Paths:
--------------
    trunk/Master/tlpkg/TeXLive/TLPDB.pm

Modified: trunk/Master/tlpkg/TeXLive/TLPDB.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLPDB.pm	2017-05-11 02:41:34 UTC (rev 44289)
+++ trunk/Master/tlpkg/TeXLive/TLPDB.pm	2017-05-11 03:13:32 UTC (rev 44290)
@@ -1404,7 +1404,8 @@
   my @expacks;
   if ($with_deps) {
     # don't expand collection->collection dependencies
-    @exppacks = $self->expand_dependencies('-no-collections', $self, @packs);
+    #@exppacks = $self->expand_dependencies('-no-collections', $self, @packs);
+    @exppacks = $self->expand_dependencies($self, @packs);
   } else {
     @exppacks = @packs;
   }
@@ -1441,17 +1442,32 @@
     $tlpsizes{'__TOTAL__'} = $totalsize;
   }
   my %realtlpsizes;
-  for my $p (@packs) {
-    $realtlpsizes{$p} = $tlpsizes{$p};
-    if ($with_deps) {
-      # do a second round and compute the sizes with dependencies
+  if (!$with_deps) {
+    for my $p (@packs) {
+      $realtlpsizes{$p} = $tlpsizes{$p};
+    }
+  } else { # the case with dependencies
+    # make three rounds: for packages, collections, schemes
+    # size computations include only those from lower-levels
+    # that is, scheme-scheme, collection-collection
+    # does not contribute to the size
+    for my $p (@exppacks) {
+      next if ($p =~ m/scheme-/);
+      next if ($p =~ m/collection-/);
+      $realtlpsizes{$p} = $tlpsizes{$p};
+    }
+    for my $p (@exppacks) {
+      # only collections
+      next if ($p !~ m/collection-/);
+      $realtlpsizes{$p} = $tlpsizes{$p};
+      ddebug("=== $p adding deps\n");
       for my $d ($tlpobjs{$p}->depends) {
-        next if ($d =~ m/\.ARCH/);
-        next if ($d =~ m/\.win32/ && !TeXLive::TLUtils::member('win32', @archs));
         next if ($d =~ m/^collection-/);
         next if ($d =~ m/^scheme-/);
+        ddebug("=== going for $d\n");
         if (defined($tlpsizes{$d})) {
           $realtlpsizes{$p} += $tlpsizes{$d};
+          ddebug("=== found $tlpsizes{$d} for $d\n");
         } else {
           # silently ignore missing defined packages - they should have
           # been computed by expand-dependencies
@@ -1459,6 +1475,25 @@
         }
       }
     }
+    for my $p (@exppacks) {
+      # only schemes
+      next if ($p !~ m/scheme-/);
+      $realtlpsizes{$p} = $tlpsizes{$p};
+      ddebug("=== $p adding deps\n");
+      for my $d ($tlpobjs{$p}->depends) {
+        # should not be necessary, we don't have collection -> scheme deps
+        next if ($d =~ m/^scheme-/);
+        ddebug("=== going for $d\n");
+        if (defined($realtlpsizes{$d})) {
+          $realtlpsizes{$p} += $realtlpsizes{$d};
+          ddebug("=== found $realtlpsizes{$d} for $d\n");
+        } else {
+          # silently ignore missing defined packages - they should have
+          # been computed by expand-dependencies
+          debug("TLPDB.pm: size with deps: sub package not found main=$d, dep=$p\n");
+        }
+      }
+    }
   }
   return \%realtlpsizes;
 }



More information about the tex-live-commits mailing list