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

commits+preining at tug.org commits+preining at tug.org
Thu Jun 7 07:55:43 CEST 2018


Revision: 47951
          http://tug.org/svn/texlive?view=revision&revision=47951
Author:   preining
Date:     2018-06-07 07:55:43 +0200 (Thu, 07 Jun 2018)
Log Message:
-----------
fix cleaning of backups with non-xz extension

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-06-07 00:24:48 UTC (rev 47950)
+++ trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl	2018-06-07 05:55:43 UTC (rev 47951)
@@ -7261,22 +7261,23 @@
   my @dirents = readdir (DIR);
   closedir (DIR) || warn "closedir($backupdir) failed: $!";
   my @backups;
+  my $extre = "(" . join("|", map { $CompressorExtension{$_} } @AcceptedCompressors) . ")";
   for my $dirent (@dirents) {
     next if (-d $dirent);
-    next if ($dirent !~ m/^$pkg\.r([0-9]+)\.tar\.xz$/);
-    push @backups, $1;
+    next if ($dirent !~ m/^$pkg\.r([0-9]+)\.tar\.$extre$/);
+    push @backups, [ $1, $dirent ] ;
   }
   my $i = 1;
-  for my $e (reverse sort {$a <=> $b} @backups) {
+  for my $e (reverse sort {$a->[0] <=> $b->[0]} @backups) {
     if ($i > $autobackup) {
       # only echo out if explicitly asked for verbose which is done
       # in the backup --clean action
       if ($verb) {
-        info ("Removing backup $backupdir/$pkg.r$e.tar.xz\n");
+        info ("Removing backup $backupdir/$e->[1]\n");
       } else {
-        debug ("Removing backup $backupdir/$pkg.r$e.tar.xz\n");
+        debug ("Removing backup $backupdir/$e->[1]\n");
       }
-      unlink("$backupdir/$pkg.r$e.tar.xz") unless $dryrun;
+      unlink("$backupdir/$e->[1]") unless $dryrun;
     }
     $i++;
   }



More information about the tex-live-commits mailing list