Module: tools Branch: master Commit: 0d401a38ec6632ac4b602efff4afe6acc8c47fc4 URL: https://source.winehq.org/git/tools.git/?a=commit;h=0d401a38ec6632ac4b602eff...
Author: Francois Gouget fgouget@codeweavers.com Date: Wed Sep 4 15:37:17 2019 +0200
testbot: Centralize adding ccache to $PATH for build scripts.
Signed-off-by: Francois Gouget fgouget@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
testbot/bin/build/Build.pl | 2 -- testbot/bin/build/Reconfig.pl | 2 -- testbot/bin/build/WineReconfig.pl | 2 -- testbot/bin/build/WineTest.pl | 2 -- testbot/lib/Build/Utils.pm | 2 ++ testbot/lib/WineTestBot/Config.pm | 5 +++++ 6 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/testbot/bin/build/Build.pl b/testbot/bin/build/Build.pl index 894686d..f23b733 100755 --- a/testbot/bin/build/Build.pl +++ b/testbot/bin/build/Build.pl @@ -114,8 +114,6 @@ sub BuildTestExecutables($$$) # Setup and command line processing #
-$ENV{PATH} = "/usr/lib/ccache:/usr/bin:/bin"; - my ($Usage, $PatchFile, $MissionStatement); while (@ARGV) { diff --git a/testbot/bin/build/Reconfig.pl b/testbot/bin/build/Reconfig.pl index c43fbda..72725bf 100755 --- a/testbot/bin/build/Reconfig.pl +++ b/testbot/bin/build/Reconfig.pl @@ -110,8 +110,6 @@ sub UpdateWineBuilds($$) # Setup and command line processing #
-$ENV{PATH} = "/usr/lib/ccache:/usr/bin:/bin"; - my ($Usage, $OptUpdate, $OptBuild, $OptNoRm, $MissionStatement); while (@ARGV) { diff --git a/testbot/bin/build/WineReconfig.pl b/testbot/bin/build/WineReconfig.pl index 4e03c31..9f0544e 100755 --- a/testbot/bin/build/WineReconfig.pl +++ b/testbot/bin/build/WineReconfig.pl @@ -142,8 +142,6 @@ sub UpdateWinePrefixes($) # Setup and command line processing #
-$ENV{PATH} = "/usr/lib/ccache:/usr/bin:/bin"; - my ($Usage, $OptUpdate, $OptBuild, $OptNoRm, $OptAddOns, $OptWinePrefix, $MissionStatement); while (@ARGV) { diff --git a/testbot/bin/build/WineTest.pl b/testbot/bin/build/WineTest.pl index f848157..a399736 100755 --- a/testbot/bin/build/WineTest.pl +++ b/testbot/bin/build/WineTest.pl @@ -209,8 +209,6 @@ sub TestExe($$$) # Setup and command line processing #
-$ENV{PATH} = "/usr/lib/ccache:/usr/bin:/bin"; - my $Action = ""; my ($Usage, $OptNoSubmit, $MissionStatement, $FileName, $BaseTag); while (@ARGV) diff --git a/testbot/lib/Build/Utils.pm b/testbot/lib/Build/Utils.pm index 61b47a7..d31db82 100644 --- a/testbot/lib/Build/Utils.pm +++ b/testbot/lib/Build/Utils.pm @@ -40,6 +40,8 @@ use WineTestBot::Missions; use WineTestBot::PatchUtils; use WineTestBot::Utils;
+WineTestBot::Config::PrependPaths("/usr/lib/ccache"); +
# # Logging and error handling diff --git a/testbot/lib/WineTestBot/Config.pm b/testbot/lib/WineTestBot/Config.pm index b72968c..b68c4f5 100644 --- a/testbot/lib/WineTestBot/Config.pm +++ b/testbot/lib/WineTestBot/Config.pm @@ -73,6 +73,11 @@ $BinDir = "$::RootDir/bin"; delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; # from perlsec $ENV{PATH} = "/usr/bin:/bin";
+sub PrependPaths(@) +{ + map { $ENV{PATH} = "$_:$ENV{PATH}" if (-d $_) } reverse @_; +} +
# See the ScheduleOnHost() documentation in lib/WineTestBot/Jobs.pm $MaxRevertingVMs = 1;