[PATCH] testbot/Janitor: Only compute the latest file ages when needed.
Francois Gouget
fgouget at codeweavers.com
Wed Jul 18 10:32:25 CDT 2018
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
testbot/bin/Janitor.pl | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/testbot/bin/Janitor.pl b/testbot/bin/Janitor.pl
index a9cdd52cd..18bbc3dea 100755
--- a/testbot/bin/Janitor.pl
+++ b/testbot/bin/Janitor.pl
@@ -310,9 +310,6 @@ if (opendir(my $dh, "$DataDir/latest"))
foreach my $Entry (@Entries)
{
next if ($Entry eq "." or $Entry eq "..");
- $Entry =~ m%^([^/]+)$%;
- my $FileName = "$DataDir/latest/$1";
- my $Age = int((-M $FileName) + 0.5);
if ($Entry =~ /^(.*)_[a-z0-9]+\.(?:err|log)$/)
{
@@ -329,6 +326,9 @@ if (opendir(my $dh, "$DataDir/latest"))
Trace "Found a suspicious latest file: $Entry\n";
if ($JobPurgeDays != 0)
{
+ $Entry =~ m%^([^/]+)$%; # untaint
+ my $FileName = "$DataDir/latest/$1";
+ my $Age = int((-M $FileName) + 0.5);
if ($Age >= $JobPurgeDays + 7)
{
DeletePath($FileName);
--
2.18.0
More information about the wine-devel
mailing list