From b8781ffe3cc542dd43f26fb4d70eb78dce77a05e Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 7 Jun 2018 05:55:43 +0000 Subject: fix cleaning of backups with non-xz extension git-svn-id: svn://tug.org/texlive/trunk@47951 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/texlive/tlmgr.pl | 13 +++++++------ 1 file 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++; } -- cgit v1.2.3