]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/backup/files/default/expire-backups
Merge remote-tracking branch 'github/pull/637'
[chef.git] / cookbooks / backup / files / default / expire-backups
index 81834d43711197c1a129044b68b25f379d98ef96..9d82c384a620c656115fd75d2c749a62e265c1e7 100644 (file)
@@ -43,12 +43,12 @@ for my $month (0 .. $months - 1)
 }
 
 my $dates = join("|", @dates);
 }
 
 my $dates = join("|", @dates);
-my $match = qr/^${prefix}\d{4}-\d{2}-\d{2}\./;
-my $keep = qr/^${prefix}(?:${dates})\./;
+my $match = qr/^\Q${prefix}\E\d{4}-\d{2}-\d{2}\./;
+my $keep = qr/^\Q${prefix}\E(?:${dates})\./;
 
 opendir(DIR, "$dir") || die "Can't open ${dir}: $!";
 
 
 opendir(DIR, "$dir") || die "Can't open ${dir}: $!";
 
-my @files = sort(grep($match, readdir(DIR)));
+my @files = sort(grep(/$match/, readdir(DIR)));
 
 closedir(DIR);
 
 
 closedir(DIR);