diff options
author | Norbert Preining <preining@logic.at> | 2018-05-18 23:47:04 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2018-05-18 23:47:04 +0000 |
commit | 8a183473880d35d01df3cc03402814a03a0bc131 (patch) | |
tree | 4006a5ffa458c1ab3f43e8bcf87b66b364e2bea0 /Master/texmf-dist/scripts | |
parent | aa4149b03f457733741370e4914fc1510e0c408b (diff) |
tlmgr initial support for lz4 backups
git-svn-id: svn://tug.org/texlive/trunk@47761 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts')
-rwxr-xr-x | Master/texmf-dist/scripts/texlive/tlmgr.pl | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl index b15bbd54a36..51b1679effe 100755 --- a/Master/texmf-dist/scripts/texlive/tlmgr.pl +++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl @@ -1761,7 +1761,15 @@ sub get_available_backups { # for my $dirent (@dirents) { next if (-d $dirent); - next if ($dirent !~ m/^(.*)\.r([0-9]+)\.tar\.xz$/); + my $has_accepted_compressiontype = 0; + for my $comptype (@AcceptedCompressors) { + my $ext = $CompressorExtension{$comptype}; + $has_accepted_compressiontype = 1 if ($dirent =~ m/\.tar\.$ext$/); + } + next if (!$has_accepted_compressiontype); + if ($dirent !~ m/^(.*)\.r([0-9]+)\.tar\.(.*)$/) { + next; + } if (!$do_stat) { $backups{$1}->{$2} = 1; next; @@ -1938,7 +1946,7 @@ sub action_restore { for my $p (sort keys %backups) { my @tmp = sort {$b <=> $a} (keys %{$backups{$p}}); my $rev = $tmp[0]; - print "Restoring $p, $rev from $opts{'backupdir'}/${p}.r${rev}.tar.xz\n"; + print "Restoring $p, $rev from $opts{'backupdir'}/${p}.r${rev}.tar.*\n"; if (!$opts{"dry-run"}) { # first remove the package, then reinstall it # this way we get rid of useless files @@ -2128,11 +2136,12 @@ 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'}; my $tlp = $localtlpdb->get_package($pkg); info("saving current status of $pkg to $opts{'backupdir'}/${pkg}.r" . - $tlp->revision . ".tar.xz\n"); + $tlp->revision . ".tar.$compressorextension\n"); if (!$opts{"dry-run"}) { - $tlp->make_container("xz", $localtlpdb->root, + $tlp->make_container("lz4", $localtlpdb->root, $opts{"backupdir"}, "${pkg}.r" . $tlp->revision); } } |