Module: tools
Branch: master
Commit: eb0484c000a380e0ba0554561de4a678b2c9c006
URL: https://source.winehq.org/git/tools.git/?a=commit;h=eb0484c000a380e0ba05545…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Thu Oct 18 11:12:54 2018 +0200
testbot/WineReconfig: Make sure not to leave obsolete wineprefixes behind.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/bin/build/WineReconfig.pl | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/testbot/bin/build/WineReconfig.pl b/testbot/bin/build/WineReconfig.pl
index 2416eeb..63d72e8 100755
--- a/testbot/bin/build/WineReconfig.pl
+++ b/testbot/bin/build/WineReconfig.pl
@@ -37,6 +37,9 @@ sub BEGIN
$::BuildEnv = 1;
}
+use File::Basename;
+use File::Path;
+
use Build::Utils;
use WineTestBot::Config;
@@ -95,6 +98,16 @@ sub UpdateWinePrefixes($)
{
my ($Targets) = @_;
+ # Make sure no obsolete wineprefix is left behind in case WineReconfig
+ # is called with a different set of targets
+ foreach my $Dir (glob("'$DataDir/wineprefix-*'"))
+ {
+ if (basename($Dir) =~ /^(wineprefix-[a-zA-Z0-9\(a)_.-]+)$/) # untaint
+ {
+ rmtree("$DataDir/$1");
+ }
+ }
+
# Set up brand new WinePrefixes ready for use for testing.
# This way we do it once instead of doing it for every test, thus saving
# time. Note that this requires using a different wineprefix for each build.