Francois Gouget : testbot/PatchUtils: Fix the module name for directories containing dots.
Alexandre Julliard
julliard at winehq.org
Tue Mar 9 14:24:29 CST 2021
Module: tools
Branch: master
Commit: c4d02668c9e46a4063055b5e9b5be1cd1d1aa7f1
URL: https://source.winehq.org/git/tools.git/?a=commit;h=c4d02668c9e46a4063055b5e9b5be1cd1d1aa7f1
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Mon Mar 8 13:40:51 2021 +0100
testbot/PatchUtils: Fix the module name for directories containing dots.
Wine forces dlls that contain dots in their names to be implemented in
a folder ending in '.dll'. But the module name and test executables
don't have this extra 'extension' and thus deriving them from the
patched filename requires special treatment.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
testbot/lib/WineTestBot/PatchUtils.pm | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/testbot/lib/WineTestBot/PatchUtils.pm b/testbot/lib/WineTestBot/PatchUtils.pm
index aeb8743..37b1b77 100644
--- a/testbot/lib/WineTestBot/PatchUtils.pm
+++ b/testbot/lib/WineTestBot/PatchUtils.pm
@@ -44,6 +44,20 @@ use WineTestBot::Utils;
# Source repository maintenance
#
+sub _Dir2ModuleName($$)
+{
+ my ($Root, $Dir) = @_;
+
+ # Add a .exe extension to program directory names, but not if they already
+ # contain some other extension.
+ return "$Dir.exe" if ($Root eq "programs" and $Dir !~ /\./);
+
+ # Dll directory names can normally be used as is, except if a '.dll'
+ # extension was added because they contain dots.
+ $Dir =~ s/\.dll$//;
+ return $Dir;
+}
+
=pod
=over 12
@@ -107,7 +121,7 @@ sub _LoadWineFiles()
my ($Root, $Module, $File) = ($1, $2, $3);
next if ($File eq "testlist.c");
next if ($File !~ /\.(?:c|spec)$/);
- $Module .= ".exe" if ($Root eq "programs" and $Module !~ /\./);
+ $Module = _Dir2ModuleName($Root, $Module);
$_TestList->{$Module}->{$File} = 1;
}
}
@@ -177,8 +191,7 @@ sub _CreateTestInfo($$$)
{
my ($Impacts, $Root, $Dir) = @_;
- # Don't add an extension to programs that have one already
- my $Module = ($Root eq "programs" and $Dir !~ /\./) ? "$Dir.exe" : $Dir;
+ my $Module = _Dir2ModuleName($Root, $Dir);
$Impacts->{BuildModules}->{$Module} = 1;
$Impacts->{IsWinePatch} = 1;
More information about the wine-cvs
mailing list