diff options
author | Norbert Preining <preining@logic.at> | 2018-05-18 23:47:18 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2018-05-18 23:47:18 +0000 |
commit | 3bc15870dc56d0f9d864db0c9b417b400ac7639f (patch) | |
tree | 20f298237ea2e91425a34e5caa460a76fe27cca9 /Master/tlpkg | |
parent | 3a86322b73c7a5688f1eba0f5edebd42255ff294 (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')
-rw-r--r-- | Master/tlpkg/TeXLive/TLPDB.pm | 12 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 27 |
2 files changed, 32 insertions, 7 deletions
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm index 34e3414b32d..72d6f1e0f82 100644 --- a/Master/tlpkg/TeXLive/TLPDB.pm +++ b/Master/tlpkg/TeXLive/TLPDB.pm @@ -1891,14 +1891,14 @@ sub not_virtual_install_package { if ($media eq 'local_uncompressed') { $container = \@installfiles; } elsif ($media eq 'local_compressed') { - for my $ext (@AcceptedCompressors) { + for my $ext (@TeXLive::TLConfig::AcceptedCompressors) { if (-r "$root/$Archive/$pkg.tar.$ext") { $container = "$root/$Archive/$pkg.tar.$ext"; } } if (!$container) { - tlwarn("TLPDB: cannot find package $pkg.tar.$AcceptedCompressorsRegexp in $root/$Archive\n"); - next; + tlwarn("TLPDB: cannot find package $pkg.tar.$TeXLive::TLConfig::AcceptedCompressorsRegexp in $root/$Archive\n"); + return(0); } } elsif (&media eq 'NET') { $container = "$root/$Archive/$pkg.$TeXLive::TLConfig::DefaultContainerExtension"; @@ -1921,13 +1921,13 @@ sub not_virtual_install_package { # - there are actually src/doc files present if ($container_src_split && $opt_src && $tlpobj->srcfiles) { my $srccontainer = $container; - $srccontainer =~ s/\.tar\.$AcceptedCompressorRegexp$/.source$1/; + $srccontainer =~ s/\.tar\.$TeXLive::TLConfig::AcceptedCompressorsRegexp$/.source.tar.$1/; $self->_install_data ($srccontainer, $reloc, \@installfiles, $totlpdb, $tlpobj->srccontainersize, $tlpobj->srccontainerchecksum) || return(0); } if ($container_doc_split && $real_opt_doc && $tlpobj->docfiles) { my $doccontainer = $container; - $doccontainer =~ s/\.tar\.$AcceptedCompressorRegexp$/.doc$1/; + $doccontainer =~ s/\.tar\.$TeXLive::TLConfig::AcceptedCompressorsRegexp$/.doc.tar.$1/; $self->_install_data ($doccontainer, $reloc, \@installfiles, $totlpdb, $tlpobj->doccontainersize, $tlpobj->doccontainerchecksum) || return(0); } @@ -2055,7 +2055,7 @@ sub _install_data { } # we always assume that copy will work return(1); - } elsif ($what =~ m,\.tar\.$AcceptedCompressorsRegexp$,) { + } elsif ($what =~ m,\.tar\.$TeXLive::TLConfig::AcceptedCompressorsRegexp$,) { if ($reloc) { if (!$totlpdb->setting("usertree")) { $target .= "/$TeXLive::TLConfig::RelocTree"; 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> |