summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/tlmgr.pl13
1 files changed, 7 insertions, 6 deletions
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl
index 2a72357846f..43be9babcae 100755
--- a/Master/texmf-dist/scripts/texlive/tlmgr.pl
+++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl
@@ -7261,22 +7261,23 @@ sub clear_old_backups {
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++;
}