diff options
-rwxr-xr-x | Master/texmf-dist/scripts/texlive/tlmgr.pl | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl index 51b1679effe..c514931693e 100755 --- a/Master/texmf-dist/scripts/texlive/tlmgr.pl +++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl @@ -2136,12 +2136,21 @@ sub action_backup { if ($clean_mode) { clear_old_backups ($pkg, $opts{"backupdir"}, $opts{"clean"}, $opts{"dry-run"}, 1); } else { - my $compressorextension = $TeXLive::TLConfig::CompressorExtension{'lz4'}; + # for now default to xz and allow overriding with env var + 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}; my $tlp = $localtlpdb->get_package($pkg); info("saving current status of $pkg to $opts{'backupdir'}/${pkg}.r" . $tlp->revision . ".tar.$compressorextension\n"); if (!$opts{"dry-run"}) { - $tlp->make_container("lz4", $localtlpdb->root, + $tlp->make_container($compressor, $localtlpdb->root, $opts{"backupdir"}, "${pkg}.r" . $tlp->revision); } } |