texlive[47761] Master/texmf-dist/scripts/texlive/tlmgr.pl: tlmgr

commits+preining at tug.org commits+preining at tug.org
Sat May 19 01:47:04 CEST 2018


Revision: 47761
          http://tug.org/svn/texlive?view=revision&revision=47761
Author:   preining
Date:     2018-05-19 01:47:04 +0200 (Sat, 19 May 2018)
Log Message:
-----------
tlmgr initial support for lz4 backups

Modified Paths:
--------------
    trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl

Modified: trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl	2018-05-18 23:46:56 UTC (rev 47760)
+++ trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl	2018-05-18 23:47:04 UTC (rev 47761)
@@ -1761,7 +1761,15 @@
   #
   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 @@
     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 @@
     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);
       }
     }



More information about the tex-live-commits mailing list