Francois Gouget : testbot/Reconfig: Clone the Wine source repository if it is missing.
Alexandre Julliard
julliard at winehq.org
Mon Sep 16 15:41:45 CDT 2019
Module: tools
Branch: master
Commit: c30f9cb730189d8a1ba07e77973bd173d401a888
URL: https://source.winehq.org/git/tools.git/?a=commit;h=c30f9cb730189d8a1ba07e77973bd173d401a888
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Mon Sep 16 15:32:13 2019 +0200
testbot/Reconfig: Clone the Wine source repository if it is missing.
This simplifies setting up a new build VM.
Also trace the git commands.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
testbot/lib/Build/Utils.pm | 14 +++++++++++---
testbot/lib/WineTestBot/Config.pm | 8 ++++++--
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/testbot/lib/Build/Utils.pm b/testbot/lib/Build/Utils.pm
index 0225392..57a5f4b 100644
--- a/testbot/lib/Build/Utils.pm
+++ b/testbot/lib/Build/Utils.pm
@@ -79,11 +79,19 @@ sub GitPull($)
{
my ($Dir) = @_;
- InfoMsg "\nUpdating the $Dir source\n";
- system("cd '$DataDir/$Dir' && git pull");
+ if (!-d "$DataDir/$Dir")
+ {
+ InfoMsg "\nRetrieving the $Dir source\n";
+ system("set -x && git clone $RepoURLs{$Dir}");
+ }
+ else
+ {
+ InfoMsg "\nUpdating the $Dir source\n";
+ system("cd '$DataDir/$Dir' && set -x && git pull");
+ }
if ($? != 0)
{
- LogMsg "Git pull failed\n";
+ LogMsg "Git clone/pull failed\n";
return !1;
}
diff --git a/testbot/lib/WineTestBot/Config.pm b/testbot/lib/WineTestBot/Config.pm
index b68c4f5..38ab999 100644
--- a/testbot/lib/WineTestBot/Config.pm
+++ b/testbot/lib/WineTestBot/Config.pm
@@ -26,7 +26,7 @@ WineTestBot::Config - Site-independent configuration settings
=cut
use vars qw (@ISA @EXPORT @EXPORT_OK $UseSSL $LogDir $DataDir $BinDir
- $DbDataSource $DbUsername $DbPassword $MaxRevertingVMs
+ %RepoURLs $DbDataSource $DbUsername $DbPassword $MaxRevertingVMs
$MaxRevertsWhileRunningVMs $MaxActiveVMs $MaxRunningVMs
$MaxVMsWhenIdle $SleepAfterRevert $WaitForToolsInVM
$VMToolTimeout $MaxVMErrors $MaxTaskTries $AdminEMail $RobotEMail
@@ -42,7 +42,7 @@ use vars qw (@ISA @EXPORT @EXPORT_OK $UseSSL $LogDir $DataDir $BinDir
require Exporter;
@ISA = qw(Exporter);
- at EXPORT = qw($UseSSL $LogDir $DataDir $BinDir
+ at EXPORT = qw($UseSSL $LogDir $DataDir $BinDir %RepoURLs
$MaxRevertingVMs $MaxRevertsWhileRunningVMs $MaxActiveVMs
$MaxRunningVMs $MaxVMsWhenIdle $SleepAfterRevert $WaitForToolsInVM
$VMToolTimeout $MaxVMErrors $MaxTaskTries $AdminEMail
@@ -79,6 +79,10 @@ sub PrependPaths(@)
}
+%RepoURLs = (
+ "wine" => "git://source.winehq.org/git/wine.git",
+);
+
# See the ScheduleOnHost() documentation in lib/WineTestBot/Jobs.pm
$MaxRevertingVMs = 1;
$MaxRevertsWhileRunningVMs = 0;
More information about the wine-cvs
mailing list