texlive[47760] Master/tlpkg/TeXLive: more work on multiple compressor

commits+preining at tug.org commits+preining at tug.org
Sat May 19 01:46:56 CEST 2018


Revision: 47760
          http://tug.org/svn/texlive?view=revision&revision=47760
Author:   preining
Date:     2018-05-19 01:46:56 +0200 (Sat, 19 May 2018)
Log Message:
-----------
more work on multiple compressor support

Modified Paths:
--------------
    trunk/Master/tlpkg/TeXLive/TLPOBJ.pm
    trunk/Master/tlpkg/TeXLive/TLUtils.pm

Modified: trunk/Master/tlpkg/TeXLive/TLPOBJ.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLPOBJ.pm	2018-05-18 23:46:50 UTC (rev 47759)
+++ trunk/Master/tlpkg/TeXLive/TLPOBJ.pm	2018-05-18 23:46:56 UTC (rev 47760)
@@ -630,6 +630,14 @@
     tlwarn("$0: programs not set up, trying \"tar\".\n");
     $tar = "tar";
   }
+
+  # determine compressor:
+  # * first try the one passed in as requested
+  # * if that one is not available, fall back to xz
+  if ($type ne "xz" && !defined($::progs{$CompressorProgram{$type}})) {
+    debug("$0: compressor of type $type not available, falling back to xz\n");
+    $type = "xz";
+  }
   my $compressor = $::progs{$CompressorProgram{$type}};
   my @compressorargs = @{$CompressorArgs{$type}};
   my $compressorextension = $CompressorExtension{$type};

Modified: trunk/Master/tlpkg/TeXLive/TLUtils.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLUtils.pm	2018-05-18 23:46:50 UTC (rev 47759)
+++ trunk/Master/tlpkg/TeXLive/TLUtils.pm	2018-05-18 23:46:56 UTC (rev 47760)
@@ -2134,9 +2134,12 @@
   }
 
   my $type;
-  for my $ext (@AcceptedCompressors) {
+  my $compressorextension;
+  for my $comptype (@AcceptedCompressors) {
+    my $ext = $CompressorExtension{$comptype};
     if ($what =~  m/\.tar\.$ext$/) {
-      $type = $ext;
+      $type = $comptype;
+      $compressorextension = $ext;
     }
   }
   if (!$type) {
@@ -2148,7 +2151,7 @@
   # my $wget = $::progs{'wget'};
   # only check the necessary compressor program
   my $decompressor = TeXLive::TLUtils::quotify_path_with_spaces($::progs{$DecompressorProgram{$type}});
-  my $decompressorArgs = $::progs{$DecompressorArgs{$type}};
+  my @decompressorArgs = @{$DecompressorArgs{$type}};
   if (!defined($decompressor)) {
     return (0, "programs not set up properly");
   }
@@ -2156,12 +2159,11 @@
 
   my $fn = basename($what);
   my $pkg = $fn;
-  # TODO use %CompressorExtensions here!!!
-  $pkg =~ s/\.tar\.$AcceptedCompressorsRegexp$//;
-  my $tarfile;
+  $pkg =~ s/\.tar\.$compressorextension$//;
   my $remove_containerfile = $remove;
   my $containerfile = "$tempdir/$fn";
-  $tarfile  = "$tempdir/$fn"; $tarfile =~ s/$AcceptedCompressorsRegexp$//;
+  my $tarfile = "$tempdir/$fn"; 
+  $tarfile =~ s/\.$compressorextension$//;
   my $containerfile_quote;
   my $tarfile_quote;
   my $target_quote;
@@ -2204,7 +2206,8 @@
     $remove_containerfile = 1;
   }
   debug("decompressing $containerfile to $tarfile\n");
-  system("$decompressor $decompressorArgs < $containerfile_quote > $tarfile_quote");
+  debug("calling $decompressor @decompressorArgs < $containerfile_quote > $tarfile_quote\n");
+  system("$decompressor @decompressorArgs < $containerfile_quote > $tarfile_quote");
   if (! -f $tarfile) {
     unlink($tarfile, $containerfile);
     return(0, "Decompressing $containerfile failed");



More information about the tex-live-commits mailing list