Francois Gouget : testbot/Janitor: Only compute the latest file ages when needed.

Alexandre Julliard julliard at winehq.org
Wed Jul 18 10:58:02 CDT 2018


Module: tools
Branch: master
Commit: 381d88c6b01512b40dc04400d9fc475adc955732
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=381d88c6b01512b40dc04400d9fc475adc955732

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Wed Jul 18 17:32:25 2018 +0200

testbot/Janitor: Only compute the latest file ages when needed.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 a9cdd52..18bbc3d 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);




More information about the wine-cvs mailing list