summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLUtils.pm
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2018-05-18 23:47:18 +0000
committerNorbert Preining <preining@logic.at>2018-05-18 23:47:18 +0000
commit3bc15870dc56d0f9d864db0c9b417b400ac7639f (patch)
tree20f298237ea2e91425a34e5caa460a76fe27cca9 /Master/tlpkg/TeXLive/TLUtils.pm
parent3a86322b73c7a5688f1eba0f5edebd42255ff294 (diff)
more lz4 support, can now be selected via TEXLIVE_COMPRESSOR=lz4
git-svn-id: svn://tug.org/texlive/trunk@47763 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLUtils.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm27
1 files changed, 26 insertions, 1 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index b92f5cc28e1..641c1986379 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -56,6 +56,7 @@ C<TeXLive::TLUtils> -- utilities used in TeX Live infrastructure
TeXLive::TLUtils::removed_dirs(@files);
TeXLive::TLUtils::download_file($path, $destination [, $progs ]);
TeXLive::TLUtils::setup_programs($bindir, $platform);
+ TeXLive::TLUtils::setup_compressor();
TeXLive::TLUtils::tlcmp($file, $file);
TeXLive::TLUtils::nulldev();
TeXLive::TLUtils::get_full_line($fh);
@@ -199,7 +200,7 @@ BEGIN {
&True
&False
);
- @EXPORT = qw(setup_programs download_file process_logging_options
+ @EXPORT = qw(setup_programs setup_compressor download_file process_logging_options
tldie tlwarn info log debug ddebug dddebug debug_hash
win32 xchdir xsystem run_cmd sort_archs);
}
@@ -2478,6 +2479,30 @@ sub setup_unix_one {
return 1;
}
+
+=item C<setup_compressor()>
+
+Setup compression method for containers.
+
+=cut
+
+# TODO TODO needs improvement, check also whether compressor prog is available!!!
+sub setup_compressor {
+ print "DEBUG: entering select compressor\n";
+ my $compressor = "xz";
+ if ($ENV{'TEXLIVE_COMPRESSOR'}) {
+ if (TeXLive::TLUtils::member($ENV{'TEXLIVE_COMPRESSOR'}, @TeXLive::TLConfig::AcceptedCompressors)) {
+ $compressor = $ENV{'TEXLIVE_COMPRESSOR'};
+ } else {
+ tlwarn("$prog: unknown compressor in TEXLIVE_COMPRESSOR=$ENV{'TEXLIVE_COMPRESSOR'}, falling back to xz\n");
+ }
+ }
+ my $compressorextension = $TeXLive::TLConfig::CompressorExtension{$compressor};
+ print "DEBUG: selected compressor $compressor\n";
+ return ($compressor, $compressorextension);
+}
+
+
=item C<download_file( $relpath, $destination [, $progs ] )>
Try to download the file given in C<$relpath> from C<$TeXLiveURL>