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/texmf-dist/scripts | |
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/texmf-dist/scripts')
-rwxr-xr-x | Master/texmf-dist/scripts/texlive/tlmgr.pl | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl index c514931693e..6b927fd2e70 100755 --- a/Master/texmf-dist/scripts/texlive/tlmgr.pl +++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl @@ -1091,7 +1091,8 @@ sub backup_and_remove_package { return($F_WARNING); } if ($opts{"backup"}) { - $tlp->make_container("xz", $localtlpdb->root, + my ($compressor, $compressorextension) = TeXLive::TLUtils::setup_compressor(); + $tlp->make_container($compressor, $localtlpdb->root, $opts{"backupdir"}, "${pkg}.r" . $tlp->revision, $tlp->relocated); @@ -1804,9 +1805,13 @@ sub restore_one_package { my ($pkg, $rev, $bd) = @_; # first remove the package, then reinstall it # this way we get rid of useless files - my $restore_file = "$bd/${pkg}.r${rev}.tar.xz"; - if (! -r $restore_file) { - tlwarn("$prg: Cannot read $restore_file, no action taken\n"); + my $restore_file; + for my $comptype (@AcceptedCompressors) { + my $ext = $CompressorExtension{$comptype}; + $restore_file = "$bd/${pkg}.r${rev}.tar.$ext" if (-r "$bd/${pkg}.r${rev}.tar.$ext"); + } + if (!$restore_file) { + tlwarn("$prg: Cannot find restore file $bd/${pkg}.r${rev}.tar.*, no action taken\n"); return ($F_ERROR); } $localtlpdb->remove_package($pkg); @@ -2137,15 +2142,7 @@ sub action_backup { clear_old_backups ($pkg, $opts{"backupdir"}, $opts{"clean"}, $opts{"dry-run"}, 1); } else { # 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 ($compressor, $compressorextension) = TeXLive::TLUtils::setup_compressor(); my $tlp = $localtlpdb->get_package($pkg); info("saving current status of $pkg to $opts{'backupdir'}/${pkg}.r" . $tlp->revision . ".tar.$compressorextension\n"); @@ -3181,11 +3178,12 @@ sub action_update { } if ($opts{"backup"} && !$opts{"dry-run"}) { - $tlp->make_container("xz", $root, + my ($compressor, $compressorextension) = TeXLive::TLUtils::setup_compressor(); + $tlp->make_container($compressor, $root, $opts{"backupdir"}, "${pkg}.r" . $tlp->revision, $tlp->relocated); $unwind_package = - "$opts{'backupdir'}/${pkg}.r" . $tlp->revision . ".tar.xz"; + "$opts{'backupdir'}/${pkg}.r" . $tlp->revision . ".tar.$compressorextension"; if ($autobackup) { # in case we do auto backups we remove older backups |