]> git.openstreetmap.org Git - chef.git/commitdiff
Don't escape wildcard prefixes during backup expiry
authorTom Hughes <tom@compton.nu>
Mon, 16 Sep 2024 16:39:29 +0000 (17:39 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 16 Sep 2024 16:39:29 +0000 (17:39 +0100)
cookbooks/backup/files/default/expire-backups

index 9d82c384a620c656115fd75d2c749a62e265c1e7..f05026193ec4c6292d8636f14ff146bc18ff42e4 100644 (file)
@@ -20,7 +20,7 @@ my @dates;
 
 if ($prefix)
 {
-    $prefix = "${prefix}-";
+    $prefix = "\Q${prefix}-\E";
 }
 else
 {
@@ -43,8 +43,8 @@ for my $month (0 .. $months - 1)
 }
 
 my $dates = join("|", @dates);
-my $match = qr/^\Q${prefix}\E\d{4}-\d{2}-\d{2}\./;
-my $keep = qr/^\Q${prefix}\E(?:${dates})\./;
+my $match = qr/^${prefix}\d{4}-\d{2}-\d{2}\./;
+my $keep = qr/^${prefix}(?:${dates})\./;
 
 opendir(DIR, "$dir") || die "Can't open ${dir}: $!";