diff options
author | Norbert Preining <preining@logic.at> | 2018-06-07 05:55:43 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2018-06-07 05:55:43 +0000 |
commit | b8781ffe3cc542dd43f26fb4d70eb78dce77a05e (patch) | |
tree | 0a3b0d0c7c5ecd9b3f95791c1ce6cdddc8279ae7 /Master/texmf-dist | |
parent | 64919f74f417ae12b673369f958c48b16180b701 (diff) |
fix cleaning of backups with non-xz extension
git-svn-id: svn://tug.org/texlive/trunk@47951 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rwxr-xr-x | Master/texmf-dist/scripts/texlive/tlmgr.pl | 13 |
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++; } |