summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLPDB.pm
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2018-06-11 06:32:20 +0000
committerNorbert Preining <preining@logic.at>2018-06-11 06:32:20 +0000
commitb5e7ffa4544901e5b21e9d195fac8ad6516c4aac (patch)
treea3303255d06fe84ffe6c5e8071e1a37238061771 /Master/tlpkg/TeXLive/TLPDB.pm
parent9ffa2d5dbcc5f110e36832888bfd6574d78d5f27 (diff)
use unified system_pipe for decompressing instead of repeating code
git-svn-id: svn://tug.org/texlive/trunk@47984 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLPDB.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLPDB.pm20
1 files changed, 4 insertions, 16 deletions
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm
index 0670a64c6f8..78cbe489323 100644
--- a/Master/tlpkg/TeXLive/TLPDB.pm
+++ b/Master/tlpkg/TeXLive/TLPDB.pm
@@ -99,7 +99,7 @@ use TeXLive::TLConfig qw($CategoriesRegexp $DefaultCategory $InfraLocation
use TeXLive::TLCrypto;
use TeXLive::TLPOBJ;
use TeXLive::TLUtils qw(dirname mkdirhier member win32 info log debug ddebug
- tlwarn basename download_file merge_into tldie);
+ tlwarn basename download_file merge_into tldie system_pipe);
use TeXLive::TLWinGoo;
use Cwd 'abs_path';
@@ -316,11 +316,6 @@ sub from_file {
($tlpdbfh, $tlpdbfile) = TeXLive::TLUtils::tl_tmpfile();
# same as above
close($tlpdbfh);
- my $tlpdbfile_quote = $tlpdbfile;
- if (win32()) {
- $tlpdbfile =~ s!/!\\!g;
- }
- $tlpdbfile_quote = "\"$tlpdbfile\"";
# if we have xz available we try the xz file
my $xz_succeeded = 0 ;
my $compressorextension = "<UNSET>";
@@ -328,12 +323,7 @@ sub from_file {
# we first try the xz compressed file
my ($xzfh, $xzfile) = TeXLive::TLUtils::tl_tmpfile();
close($xzfh);
- my $xzfile_quote = $xzfile;
- if (win32()) {
- $xzfile =~ s!/!\\!g;
- }
- $xzfile_quote = "\"$xzfile\"";
- my $decompressor = TeXLive::TLUtils::quotify_path_with_spaces($::progs{$DecompressorProgram{$DefaultCompressorFormat}});
+ my $decompressor = $::progs{$DecompressorProgram{$DefaultCompressorFormat}};
$compressorextension = $CompressorExtension{$DefaultCompressorFormat};
my @decompressorArgs = @{$DecompressorArgs{$DefaultCompressorFormat}};
debug("trying to download $path.$compressorextension to $xzfile\n");
@@ -345,12 +335,10 @@ sub from_file {
# xz *hopefully* returns 0 on success and anything else on failure
# we don't have to negate since not zero means error in the shell
# and thus in perl true
- if (system("$decompressor @decompressorArgs <$xzfile_quote >$tlpdbfile_quote")) {
+ if (!system_pipe($decompressor, $xzfile, $tlpdbfile, 1, @decompressorArgs)) {
debug("$decompressor $xzfile failed, trying plain file\n");
- # to be sure we unlink the xz file and the tlpdbfile
- unlink($xzfile);
+ unlink($xzfile); # the above command only removes in case of success
} else {
- unlink($xzfile);
$xz_succeeded = 1;
debug("found the uncompressed $DefaultCompressorFormat file\n");
}