summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2018-05-18 23:46:56 +0000
committerNorbert Preining <preining@logic.at>2018-05-18 23:46:56 +0000
commitaa4149b03f457733741370e4914fc1510e0c408b (patch)
tree577b4b575b39e1a788df2ca9c3664b53becc6154 /Master/tlpkg/TeXLive
parenta5eb764bf2b6f48b060a238df33fe168b049df57 (diff)
more work on multiple compressor support
git-svn-id: svn://tug.org/texlive/trunk@47760 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r--Master/tlpkg/TeXLive/TLPOBJ.pm8
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm19
2 files changed, 19 insertions, 8 deletions
diff --git a/Master/tlpkg/TeXLive/TLPOBJ.pm b/Master/tlpkg/TeXLive/TLPOBJ.pm
index ca1d1100931..e0e5db16dfe 100644
--- a/Master/tlpkg/TeXLive/TLPOBJ.pm
+++ b/Master/tlpkg/TeXLive/TLPOBJ.pm
@@ -630,6 +630,14 @@ sub make_container {
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};
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index 4a5aebbb304..b92f5cc28e1 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -2134,9 +2134,12 @@ sub unpack {
}
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 @@ sub unpack {
# 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 @@ sub unpack {
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 @@ sub unpack {
$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");