summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLUtils.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/TeXLive/TLUtils.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm33
1 files changed, 12 insertions, 21 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index da59eb99bdd..077d6015f5a 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -2169,30 +2169,22 @@ sub unpack {
return (0, "nothing to unpack");
}
- my $type;
+ my $decompressor;
my $compressorextension;
- for my $comptype (@AcceptedCompressors) {
- my $ext = $CompressorExtension{$comptype};
- if ($what =~ m/\.tar\.$ext$/) {
- $type = $comptype;
- $compressorextension = $ext;
- }
+ if ($what =~ m/\.tar\.$CompressorExtRegexp$/) {
+ $compressorextension = $1;
+ $decompressor = $1 eq "gz" ? "gzip" : $1;
}
- if (!$type) {
+ if (!$decompressor) {
return(0, "don't know how to unpack");
}
# make sure that the found uncompressor type is also available
- if (!member($type, @{$::progs{'working_compressors'}})) {
- return(0, "unsupported container format $type");
+ if (!member($decompressor, @{$::progs{'working_compressors'}})) {
+ return(0, "unsupported container format $decompressor");
}
# only check the necessary compressor program
- my $decompressor = $::progs{$DecompressorProgram{$type}};
- my @decompressorArgs = @{$DecompressorArgs{$type}};
- if (!defined($decompressor)) {
- return (0, "programs not set up properly");
- }
-
+ my @decompressorArgs = @{$Compressors{$compressor}{'decompress_args'}};
my $fn = basename($what);
my $pkg = $fn;
@@ -2383,16 +2375,15 @@ sub setup_programs {
}
$::progs{'working_downloaders'} = [ @working_downloaders ];
my @working_compressors;
- for my $comptype (@AcceptedCompressors) {
- my $defprog = $CompressorProgram{$comptype};
+ for my $defprog (sort {$Compressors{$a}{'priority'} <=> $Compressors{$b}{'priority'}} keys %Compressors) {
# do not warn on errors
if (setup_one(($isWin ? "w32" : "unix"), $defprog,
- "$bindir/$comptype/$defprog.$platform", "--version", 1)) {
- push @working_compressors, $comptype;
+ "$bindir/$defprog/$defprog.$platform", "--version", 1)) {
+ push @working_compressors, $defprog;
# also set up $::{'compressor'} if not already done
# this selects the first one, but we might reset this depending on
# TEXLIVE_COMPRESSOR setting, see below
- defined($::progs{'compressor'}) || ($::progs{'compressor'} = $comptype);
+ defined($::progs{'compressor'}) || ($::progs{'compressor'} = $defprog);
}
}
$::progs{'working_compressors'} = [ @working_compressors ];