Francois Gouget : testbot: Add a GetMTime() helper function.
Module: tools Branch: master Commit: 3660dda79a906164501d0c25edb0455ee5e40773 URL: https://source.winehq.org/git/tools.git/?a=commit;h=3660dda79a906164501d0c25... Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Wed Sep 18 10:07:58 2019 +0200 testbot: Add a GetMTime() helper function. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- testbot/bin/CheckForWinetestUpdate.pl | 2 +- testbot/lib/WineTestBot/PatchUtils.pm | 3 ++- testbot/lib/WineTestBot/Utils.pm | 8 +++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/testbot/bin/CheckForWinetestUpdate.pl b/testbot/bin/CheckForWinetestUpdate.pl index b4672a7..6576e30 100755 --- a/testbot/bin/CheckForWinetestUpdate.pl +++ b/testbot/bin/CheckForWinetestUpdate.pl @@ -118,7 +118,7 @@ sub UpdateWineTest($$) my $Request = HTTP::Request->new(GET => $WineTestUrls{$Build}); if (-r $LatestFileName) { - my $Since = gmtime((stat $LatestFileName)[9]); + my $Since = gmtime(GetMTime($LatestFileName)); $Request->header("If-Modified-Since" => "$Since GMT"); } Debug("Checking $WineTestUrls{$Build}\n"); diff --git a/testbot/lib/WineTestBot/PatchUtils.pm b/testbot/lib/WineTestBot/PatchUtils.pm index d96b14a..71be9cf 100644 --- a/testbot/lib/WineTestBot/PatchUtils.pm +++ b/testbot/lib/WineTestBot/PatchUtils.pm @@ -37,6 +37,7 @@ our @EXPORT = qw(GetPatchImpacts LastPartSeparator UpdateWineData use List::Util qw(min max); use WineTestBot::Config; +use WineTestBot::Utils; # @@ -83,7 +84,7 @@ files and a hashtable of all the Wine files. sub _LoadWineFiles() { my $FileName = "$DataDir/latest/winefiles.txt"; - my $MTime = (stat($FileName))[9] || 0; + my $MTime = GetMTime($FileName); if ($_TestList and $_TimeStamp == $MTime) { diff --git a/testbot/lib/WineTestBot/Utils.pm b/testbot/lib/WineTestBot/Utils.pm index 711917c..309fb19 100644 --- a/testbot/lib/WineTestBot/Utils.pm +++ b/testbot/lib/WineTestBot/Utils.pm @@ -28,7 +28,7 @@ WineTestBot::Utils - Utility functions use Exporter 'import'; our @EXPORT = qw(MakeSecureURL SecureConnection GenerateRandomString - OpenNewFile CreateNewFile CreateNewLink CreateNewDir + OpenNewFile CreateNewFile CreateNewLink CreateNewDir GetMTime DurationToString BuildEMailRecipient IsValidFileName BuildTag SanitizeTag LocaleName NotifyAdministrator BatchQuote ShQuote ShArgv2Cmd); @@ -255,6 +255,12 @@ sub CreateNewDir($$) } } +sub GetMTime($) +{ + my ($Filename) = @_; + return (stat($Filename))[9] || 0; +} + # # WineTest helpers
participants (1)
-
Alexandre Julliard